summaryrefslogtreecommitdiff
path: root/sw/source/core/crsr/FormFieldButton.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-12-03 10:21:23 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-12-03 13:35:28 +0100
commit80646f9ab79573a1575952ac44a9450c383c0180 (patch)
tree73e1de5ff74f36a6bd14f9c01409fa0538d1ab0d /sw/source/core/crsr/FormFieldButton.cxx
parente5dff842437cfaa949f66d93b3bcb6df1d6c470d (diff)
show form dropdown on mouse press not release
otherwise clicking on on the button when the dropdown is shown will cause a new dropdown to appear, not just dismiss the original Change-Id: Id417c8135d41797e00ed0f785c5ca91adf44e287 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107152 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/core/crsr/FormFieldButton.cxx')
-rw-r--r--sw/source/core/crsr/FormFieldButton.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/core/crsr/FormFieldButton.cxx b/sw/source/core/crsr/FormFieldButton.cxx
index 43d8ff6e07e9..65412b3f558b 100644
--- a/sw/source/core/crsr/FormFieldButton.cxx
+++ b/sw/source/core/crsr/FormFieldButton.cxx
@@ -56,19 +56,18 @@ void FormFieldButton::CalcPosAndSize(const SwRect& rPortionPaintArea)
}
}
-void FormFieldButton::MouseButtonUp(const MouseEvent&)
+void FormFieldButton::MouseButtonDown(const MouseEvent&)
{
assert(GetParent());
- Point aPixPos = GetPosPixel();
- aPixPos.AdjustY(GetSizePixel().Height());
-
// sets m_pFieldPopup
InitPopup();
m_pFieldPopup->SetPopupModeEndHdl(LINK(this, DropDownFormFieldButton, FieldPopupModeEndHdl));
- tools::Rectangle aRect(GetParent()->OutputToScreenPixel(aPixPos), Size(0, 0));
+ Size aSize = GetSizePixel();
+ Point aPos(GetParent()->OutputToScreenPixel(GetPosPixel()));
+ tools::Rectangle aRect(aPos, aSize);
m_pFieldPopup->StartPopupMode(aRect, FloatWinPopupFlags::Down | FloatWinPopupFlags::GrabFocus);
Invalidate();
}