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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 2 13:34:01 UTC 2021


 vcl/unx/gtk3/gtkinst.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 71b704d6809166b56804b8dc843431215af0490b
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jun 2 12:43:33 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jun 2 15:33:14 2021 +0200

    gtk4: replace 'help' button text with a 'help-browser' icon
    
    seems to fit the aesthetic a bit better
    
    Change-Id: I689eb3d8928bff1531758d3ab0e3e62ebb8a37d9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116589
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 3b46332e54ed..1ca473c9c06d 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -20985,6 +20985,20 @@ ConvertResult Convert3To4(const Reference<css::xml::dom::XNode>& xNode)
                     xRemoveList.push_back(xChild);
             }
 
+            // remove 'Help' button label and replace with a help icon instead
+            if (sName == "label" && GetParentObjectType(xChild) == "GtkButton")
+            {
+                css::uno::Reference<css::xml::dom::XNamedNodeMap> xParentMap = xChild->getParentNode()->getAttributes();
+                css::uno::Reference<css::xml::dom::XNode> xId = xParentMap->getNamedItem("id");
+                if (xId && xId->getNodeValue() == "help")
+                {
+                    auto xDoc = xChild->getOwnerDocument();
+                    auto xIconName = CreateProperty(xDoc, "icon-name", "help-browser-symbolic");
+                    xChild->getParentNode()->insertBefore(xIconName, xChild);
+                    xRemoveList.push_back(xChild);
+                }
+            }
+
             if (sName == "icon-size")
             {
                 if (GetParentObjectType(xChild) == "GtkImage")


More information about the Libreoffice-commits mailing list