[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon May 13 20:20:32 UTC 2019


 vcl/unx/gtk3/gtk3gtkinst.cxx |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

New commits:
commit 2c9082ed60d13aecb5eaeadc5b14a5a87896a907
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon May 13 15:57:07 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon May 13 22:19:40 2019 +0200

    fix up GtkToolButton images
    
    Change-Id: I68d3fac978531e780c16e4a41a619d7a6c00cabb
    Reviewed-on: https://gerrit.libreoffice.org/72248
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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;


More information about the Libreoffice-commits mailing list