vcl/source/window/builder.cxx | 8 +++++++- vcl/unx/gtk3/gtk3gtkinst.cxx | 27 +++++++++++++++------------ 2 files changed, 22 insertions(+), 13 deletions(-)
New commits: commit bd567a409f214d042bd64798f168fdb3dbf3cd31 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Oct 6 20:47:22 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Oct 7 16:18:36 2020 +0200 support pan-down-symbolic/pan-up-symbolic as SPIN_DOWN/SPIN_UP Change-Id: I37bb7474207a084cfce7a3c2a6d9ec507b963aba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104044 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index e182fc265b66..a3b91e718f49 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -655,7 +655,13 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr { if (!elem.m_bRadio) { - pTargetButton->SetModeImage(pImage->GetImage()); + const Image& rImage = pImage->GetImage(); + if (rImage.GetStock() == "pan-down-symbolic") + pTargetButton->SetSymbol(SymbolType::SPIN_DOWN); + else if (rImage.GetStock() == "pan-up-symbolic") + pTargetButton->SetSymbol(SymbolType::SPIN_UP); + else + pTargetButton->SetModeImage(rImage); if (pImage->GetStyle() & WB_SMALLSTYLE) { pTargetButton->SetStyle(pTargetButton->GetStyle() | WB_SMALLSTYLE); diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 8d4dff537f38..ddea5a54a9aa 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -16027,28 +16027,31 @@ private: if (icon_name) { OUString aIconName(icon_name, strlen(icon_name), RTL_TEXTENCODING_UTF8); - GdkPixbuf* pixbuf = load_icon_by_name_theme_lang(aIconName, m_aIconTheme, m_aUILang); - if (pixbuf) + if (aIconName != "pan-up-symbolic" && aIconName != "pan-down-symbolic") { - gtk_image_set_from_pixbuf(pImage, pixbuf); - g_object_unref(pixbuf); + if (GdkPixbuf* pixbuf = load_icon_by_name_theme_lang(aIconName, m_aIconTheme, m_aUILang)) + { + gtk_image_set_from_pixbuf(pImage, pixbuf); + g_object_unref(pixbuf); + } } } } 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) + if (const gchar* icon_name = gtk_tool_button_get_icon_name(pToolButton)) { OUString aIconName(icon_name, strlen(icon_name), RTL_TEXTENCODING_UTF8); - GdkPixbuf* pixbuf = load_icon_by_name_theme_lang(aIconName, m_aIconTheme, m_aUILang); - if (pixbuf) + if (aIconName != "pan-up-symbolic" && aIconName != "pan-down-symbolic") { - GtkWidget* pImage = gtk_image_new_from_pixbuf(pixbuf); - g_object_unref(pixbuf); - gtk_tool_button_set_icon_widget(pToolButton, pImage); - gtk_widget_show(pImage); + if (GdkPixbuf* pixbuf = load_icon_by_name_theme_lang(aIconName, m_aIconTheme, m_aUILang)) + { + GtkWidget* pImage = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + gtk_tool_button_set_icon_widget(pToolButton, pImage); + gtk_widget_show(pImage); + } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits