diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-10-06 20:47:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-10-07 16:18:36 +0200 |
commit | bd567a409f214d042bd64798f168fdb3dbf3cd31 (patch) | |
tree | adeee018b2f0cc4acd72b4e42042f98a1bd4c825 | |
parent | 3f359a03308493e59e0c29572fff7b0194c4aea1 (diff) |
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 <caolanm@redhat.com>
-rw-r--r-- | vcl/source/window/builder.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 27 |
2 files changed, 22 insertions, 13 deletions
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); + } } } |