summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-05-13 15:57:07 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-05-13 22:19:40 +0200
commit2c9082ed60d13aecb5eaeadc5b14a5a87896a907 (patch)
treeac424019a44754f9d34d1d093f3dfe90aef4d94c /vcl
parentfdfde111d014703799f3e997501fbc1cd14e638f (diff)
fix up GtkToolButton images
Change-Id: I68d3fac978531e780c16e4a41a619d7a6c00cabb Reviewed-on: https://gerrit.libreoffice.org/72248 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index cf554c95f6f5..d92c81c0c426 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -9690,6 +9690,24 @@ private:
}
}
}
+ else if (GTK_IS_TOOL_BUTTON(pWidget))
+ {
+ GtkToolButton* pToolButton = GTK_TOOL_BUTTON(pWidget);
+ const gchar* icon_name = gtk_tool_button_get_icon_name(pToolButton);
+ if (icon_name)
+ {
+ OUString aIconName(icon_name, strlen(icon_name), RTL_TEXTENCODING_UTF8);
+ GdkPixbuf* pixbuf = load_icon_by_name(aIconName, m_aIconTheme, m_aUILang);
+ if (pixbuf)
+ {
+ GtkWidget* pImage = gtk_image_new_from_pixbuf(pixbuf);
+ g_object_unref(pixbuf);
+ gtk_tool_button_set_icon_widget(pToolButton, pImage);
+ gtk_widget_show(pImage);
+ }
+ }
+ }
+
//set helpids
const gchar* pStr = gtk_buildable_get_name(GTK_BUILDABLE(pWidget));
size_t nLen = pStr ? strlen(pStr) : 0;