summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-12-23 11:16:28 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-12-23 17:00:58 +0100
commitb7570a5f9d026f7cd6f064594bd7599fe36e9a14 (patch)
treeba091454feae5ee8f9c9bf985e9ff46961493211 /vcl/unx
parentfebb1b2861ce276ad79fccd95e9eadc9e435603c (diff)
reorganize ToolbarUnoDispatcher to be useful for sidebar
Change-Id: If129d4832f04758705e121bff88ea7d2e45bf96b Reviewed-on: https://gerrit.libreoffice.org/85755 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx36
1 files changed, 36 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 152893cad43f..05e0b89efad0 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -7122,6 +7122,18 @@ public:
return gtk_widget_get_sensitive(GTK_WIDGET(m_aMap.find(rIdent)->second));
}
+ virtual void set_item_visible(const OString& rIdent, bool bVisible) override
+ {
+ disable_item_notify_events();
+ gtk_widget_set_visible(GTK_WIDGET(m_aMap[rIdent]), bVisible);
+ enable_item_notify_events();
+ }
+
+ virtual bool get_item_visible(const OString& rIdent) const override
+ {
+ return gtk_widget_get_visible(GTK_WIDGET(m_aMap.find(rIdent)->second));
+ }
+
virtual void set_item_active(const OString& rIdent, bool bActive) override
{
disable_item_notify_events();
@@ -7178,12 +7190,30 @@ public:
return OString(pStr, pStr ? strlen(pStr) : 0);
}
+ virtual void set_item_ident(int nIndex, const OString& rIdent) override
+ {
+ GtkToolItem* pItem = gtk_toolbar_get_nth_item(m_pToolbar, nIndex);
+ gtk_buildable_set_name(GTK_BUILDABLE(pItem), rIdent.getStr());
+ }
+
virtual void set_item_label(int nIndex, const OUString& rLabel) override
{
GtkToolItem* pItem = gtk_toolbar_get_nth_item(m_pToolbar, nIndex);
gtk_tool_button_set_label(GTK_TOOL_BUTTON(pItem), MapToGtkAccelerator(rLabel).getStr());
}
+ virtual void set_item_label(const OString& rIdent, const OUString& rLabel) override
+ {
+ GtkToolButton* pItem = m_aMap[rIdent];
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(pItem), MapToGtkAccelerator(rLabel).getStr());
+ }
+
+ OUString get_item_label(const OString& rIdent) const override
+ {
+ const gchar* pText = gtk_tool_button_get_label(m_aMap.find(rIdent)->second);
+ return OUString(pText, pText ? strlen(pText) : 0, RTL_TEXTENCODING_UTF8);
+ }
+
virtual void set_item_icon(int nIndex, const css::uno::Reference<css::graphic::XGraphic>& rIcon) override
{
GtkToolItem* pItem = gtk_toolbar_get_nth_item(m_pToolbar, nIndex);
@@ -7206,6 +7236,12 @@ public:
gtk_widget_set_tooltip_text(GTK_WIDGET(pItem), OUStringToOString(rTip, RTL_TEXTENCODING_UTF8).getStr());
}
+ virtual void set_item_tooltip_text(const OString& rIdent, const OUString& rTip) override
+ {
+ GtkToolButton* pItem = m_aMap[rIdent];
+ gtk_widget_set_tooltip_text(GTK_WIDGET(pItem), OUStringToOString(rTip, RTL_TEXTENCODING_UTF8).getStr());
+ }
+
virtual vcl::ImageType get_icon_size() const override
{
return GtkToVcl(gtk_toolbar_get_icon_size(m_pToolbar));