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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 15 15:08:06 UTC 2021


 vcl/unx/gtk4/convert3to4.cxx |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 7099902bc9ebdc5407d7cd917a57188bb575dd66
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jun 15 12:40:19 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jun 15 17:07:15 2021 +0200

    gtk4: convert all the larger old icon sizes to GTK_ICON_SIZE_LARGE
    
    Change-Id: I88921495e60f47b54e4d473315ee953872e61891
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117248
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk4/convert3to4.cxx b/vcl/unx/gtk4/convert3to4.cxx
index d1d56926acd9..f99bdc9517ff 100644
--- a/vcl/unx/gtk4/convert3to4.cxx
+++ b/vcl/unx/gtk4/convert3to4.cxx
@@ -493,17 +493,26 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode
             {
                 if (GetParentObjectType(xChild) == "GtkImage")
                 {
-                    if (xChild->getFirstChild()->getNodeValue() == "6")
+                    OUString sSize = xChild->getFirstChild()->getNodeValue();
+                    /*
+                      old:
+                       3 -> GTK_ICON_SIZE_LARGE_TOOLBAR: Size appropriate for large toolbars (24px)
+                       5 -> GTK_ICON_SIZE_DND: Size appropriate for drag and drop (32px)
+                       6 -> GTK_ICON_SIZE_DIALOG: Size appropriate for dialogs (48px)
+
+                      new:
+                       2 -> GTK_ICON_SIZE_LARGE
+                    */
+                    if (sSize == "3" || sSize == "5" || sSize == "6")
                     {
                         auto xDoc = xChild->getOwnerDocument();
-                        // convert old GTK_ICON_SIZE_DIALOG to new GTK_ICON_SIZE_LARGE
                         auto xIconSize = CreateProperty(xDoc, "icon-size", "2");
                         xChild->getParentNode()->insertBefore(xIconSize, xChild);
-                        xRemoveList.push_back(xChild);
                     }
                     else
                         SAL_WARN("vcl.gtk", "what should we do with an icon-size of: "
                                                 << xChild->getFirstChild()->getNodeValue());
+                    xRemoveList.push_back(xChild);
                 }
                 else if (GetParentObjectType(xChild) == "GtkPicture")
                     xRemoveList.push_back(xChild);


More information about the Libreoffice-commits mailing list