diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-12-03 10:21:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-12-03 13:35:28 +0100 |
commit | 80646f9ab79573a1575952ac44a9450c383c0180 (patch) | |
tree | 73e1de5ff74f36a6bd14f9c01409fa0538d1ab0d /sw/source | |
parent | e5dff842437cfaa949f66d93b3bcb6df1d6c470d (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')
-rw-r--r-- | sw/source/core/crsr/FormFieldButton.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/inc/FormFieldButton.hxx | 2 |
2 files changed, 5 insertions, 6 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(); } diff --git a/sw/source/core/inc/FormFieldButton.hxx b/sw/source/core/inc/FormFieldButton.hxx index 265d0bafb713..93a7079651fb 100644 --- a/sw/source/core/inc/FormFieldButton.hxx +++ b/sw/source/core/inc/FormFieldButton.hxx @@ -32,7 +32,7 @@ public: void CalcPosAndSize(const SwRect& rPortionPaintArea); - virtual void MouseButtonUp(const MouseEvent& rMEvt) override; + virtual void MouseButtonDown(const MouseEvent& rMEvt) override; DECL_LINK(FieldPopupModeEndHdl, FloatingWindow*, void); virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; |