summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-03-21 14:50:56 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-03-21 16:50:08 +0100
commit3eb14808495fc930c481ee6842574abf8f8608ab (patch)
treefb5fbe67d7836a8baf8297c852bfb793630aecc0
parent0ef2443c856b2685c6c234d6c2016d30fb25a78e (diff)
add get_modifier_state to toolbar for what modifiers are held
Change-Id: I77e7f6238d82249ffede1edee2dc88f1a76b3717 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90860 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/vcl/weld.hxx3
-rw-r--r--vcl/source/app/salvtables.cxx5
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx7
3 files changed, 15 insertions, 0 deletions
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 861b7d9b9a69..b7bf769063c6 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -2073,6 +2073,9 @@ public:
virtual vcl::ImageType get_icon_size() const = 0;
virtual void set_icon_size(vcl::ImageType eType) = 0;
+ // return what modifiers are held
+ virtual sal_uInt16 get_modifier_state() const = 0;
+
void connect_clicked(const Link<const OString&, void>& rLink) { m_aClickHdl = rLink; }
void connect_menu_toggled(const Link<const OString&, void>& rLink) { m_aToggleMenuHdl = rLink; }
};
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index c0f203df68bd..42621850fe23 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1007,6 +1007,11 @@ public:
}
}
+ virtual sal_uInt16 get_modifier_state() const override
+ {
+ return m_xToolBox->GetModifier();
+ }
+
virtual ~SalInstanceToolbar() override
{
m_xToolBox->SetDropdownClickHdl(Link<ToolBox*, void>());
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index d8c0213e8750..6f11a6a89017 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -7794,6 +7794,13 @@ public:
return gtk_toolbar_set_icon_size(m_pToolbar, VclToGtk(eType));
}
+ virtual sal_uInt16 get_modifier_state() const override
+ {
+ GdkKeymap* pKeymap = gdk_keymap_get_default();
+ guint nState = gdk_keymap_get_modifier_state(pKeymap);
+ return GtkSalFrame::GetKeyModCode(nState);
+ }
+
virtual ~GtkInstanceToolbar() override
{
for (auto& a : m_aMap)