[Libreoffice-commits] core.git: include/vcl vcl/source vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sat Mar 21 15:50:44 UTC 2020
include/vcl/weld.hxx | 3 +++
vcl/source/app/salvtables.cxx | 5 +++++
vcl/unx/gtk3/gtk3gtkinst.cxx | 7 +++++++
3 files changed, 15 insertions(+)
New commits:
commit 3eb14808495fc930c481ee6842574abf8f8608ab
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Mar 21 14:50:56 2020 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Mar 21 16:50:08 2020 +0100
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 at redhat.com>
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)
More information about the Libreoffice-commits
mailing list