diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-12-03 11:13:54 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-12-03 14:23:58 +0100 |
commit | a16d2f95783839d54b3c0b2d4c88f96ad3afa404 (patch) | |
tree | b8ab79f82ca7bf592a1b89aed1cb318abfbb9c96 /sw | |
parent | f85d860ccbebd99bc128218148e2992c9415f221 (diff) |
inherit FormFieldButton from Control
instead of MenuButton, it overrides the parts of MenuButton that
make it a MenuButton
Change-Id: Id2317ec09dd0f8084efe341b1091787c36d51f12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107157
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/FormFieldButton.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/inc/FormFieldButton.hxx | 9 |
2 files changed, 11 insertions, 9 deletions
diff --git a/sw/source/core/crsr/FormFieldButton.cxx b/sw/source/core/crsr/FormFieldButton.cxx index 65412b3f558b..8ae84826a3f9 100644 --- a/sw/source/core/crsr/FormFieldButton.cxx +++ b/sw/source/core/crsr/FormFieldButton.cxx @@ -15,11 +15,16 @@ #include <vcl/event.hxx> FormFieldButton::FormFieldButton(SwEditWin* pEditWin, sw::mark::Fieldmark& rFieldmark) - : MenuButton(pEditWin, WB_DIALOGCONTROL) + : Control(pEditWin, WB_DIALOGCONTROL) , m_rFieldmark(rFieldmark) { assert(GetParent()); assert(dynamic_cast<SwEditWin*>(GetParent())); + + SetBackground(); + EnableChildTransparentMode(); + SetParentClipMode(ParentClipMode::NoClip); + SetPaintTransparent(true); } FormFieldButton::~FormFieldButton() { disposeOnce(); } @@ -27,7 +32,7 @@ FormFieldButton::~FormFieldButton() { disposeOnce(); } void FormFieldButton::dispose() { m_pFieldPopup.disposeAndClear(); - MenuButton::dispose(); + Control::dispose(); } void FormFieldButton::CalcPosAndSize(const SwRect& rPortionPaintArea) @@ -137,7 +142,7 @@ void FormFieldButton::Paint(vcl::RenderContext& rRenderContext, const tools::Rec WindowHitTest FormFieldButton::ImplHitTest(const Point& rFramePos) { // We need to check whether the position hits the button (the frame should be mouse transparent) - WindowHitTest aResult = MenuButton::ImplHitTest(rFramePos); + WindowHitTest aResult = Control::ImplHitTest(rFramePos); if (aResult != WindowHitTest::Inside) return aResult; else diff --git a/sw/source/core/inc/FormFieldButton.hxx b/sw/source/core/inc/FormFieldButton.hxx index 93a7079651fb..4dec3b752d13 100644 --- a/sw/source/core/inc/FormFieldButton.hxx +++ b/sw/source/core/inc/FormFieldButton.hxx @@ -7,10 +7,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef INCLUDED_SW_SOURCE_CORE_TEXT_FORMEFIELDBUTTO_HXX -#define INCLUDED_SW_SOURCE_CORE_TEXT_FORMEFIELDBUTTO_HXX +#pragma once -#include <vcl/menubtn.hxx> +#include <vcl/ctrl.hxx> #include <swrect.hxx> class SwEditWin; @@ -23,7 +22,7 @@ class Fieldmark; /** * This button is shown when the cursor is on a form field with drop-down capability. */ -class FormFieldButton : public MenuButton +class FormFieldButton : public Control { public: FormFieldButton(SwEditWin* pEditWin, sw::mark::Fieldmark& rFieldMark); @@ -48,6 +47,4 @@ protected: VclPtr<FloatingWindow> m_pFieldPopup; }; -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |