From fb3c3b2861b6e658c260a22cc58c3f69be327b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 19 Oct 2020 09:35:00 +0100 Subject: [PATCH] add MenuToggleButton for split toggle/menu button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit which is uniquely used in the start center Change-Id: I098e79ce34a9d99f8fb2eccb3dd04fa27e38427b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104534 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- include/vcl/menubtn.hxx | 1 + include/vcl/weld.hxx | 7 + solenv/sanitizers/ui/vcl.suppr | 2 + vcl/UIConfig_vcl.mk | 1 + vcl/inc/salvtables.hxx | 3 + vcl/source/app/salvtables.cxx | 37 ++++ vcl/source/control/menubtn.cxx | 4 + vcl/source/window/builder.cxx | 33 ++- vcl/uiconfig/ui/menutogglebutton.ui | 40 ++++ vcl/unx/gtk3/gtk3gtkinst.cxx | 320 ++++++++++++++++++++++++++-- 10 files changed, 424 insertions(+), 24 deletions(-) create mode 100644 vcl/uiconfig/ui/menutogglebutton.ui diff --git a/include/vcl/menubtn.hxx b/include/vcl/menubtn.hxx index ea6916a48629..fef1ad346805 100644 --- a/include/vcl/menubtn.hxx +++ b/include/vcl/menubtn.hxx @@ -99,6 +99,7 @@ public: virtual ~MenuToggleButton() override; void SetActive( bool bSel ); + bool GetActive() const; }; #endif // INCLUDED_VCL_MENUBTN_HXX diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index e463084da93b..d2a49e7ec1d1 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1396,6 +1396,12 @@ public: virtual void set_popover(weld::Widget* pPopover) = 0; }; +// Similar to a MenuButton except it is split into two parts, a toggle +// button at the start and a menubutton at the end +class VCL_DLLPUBLIC MenuToggleButton : virtual public MenuButton +{ +}; + class VCL_DLLPUBLIC CheckButton : virtual public ToggleButton { }; @@ -2248,6 +2254,7 @@ public: virtual std::unique_ptr weld_paned(const OString& id) = 0; virtual std::unique_ptr