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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 16 07:54:55 UTC 2021


 cui/uiconfig/ui/areatabpage.ui |   47 +++++++++++++++++++------------------
 vcl/unx/gtk3/gtkinst.cxx       |    9 +++++++
 vcl/unx/gtk4/convert3to4.cxx   |   51 ++++++++++++++++++++++++++---------------
 3 files changed, 66 insertions(+), 41 deletions(-)

New commits:
commit ecdb4b2ca8a55b8b2d077cabd930964a41624736
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jun 15 16:58:32 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jun 16 09:53:52 2021 +0200

    gtk4: use image-position to position elements within replacement box
    
    enable insert, section with pick button in color subtab of background
    tabpage as example usage
    
    Change-Id: Ie972e2de9181888b59159a7a12651e6f7f7dec26
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117275
    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 2f04556c88f1..b8ece3292b5d 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -22242,8 +22242,11 @@ weld::Builder* GtkInstance::CreateBuilder(weld::Widget* pParent, const OUString&
         rUIFile != "cui/ui/acorreplacepage.ui" &&
         rUIFile != "cui/ui/applyautofmtpage.ui" &&
         rUIFile != "cui/ui/applylocalizedpage.ui" &&
+        rUIFile != "cui/ui/areatabpage.ui" &&
         rUIFile != "cui/ui/autocorrectdialog.ui" &&
+        rUIFile != "cui/ui/bitmaptabpage.ui" &&
         rUIFile != "cui/ui/breaknumberoption.ui" &&
+        rUIFile != "cui/ui/colorpage.ui" &&
         rUIFile != "cui/ui/colorpickerdialog.ui" &&
         rUIFile != "cui/ui/editdictionarydialog.ui" &&
         rUIFile != "cui/ui/eventassigndialog.ui" &&
@@ -22264,6 +22267,7 @@ weld::Builder* GtkInstance::CreateBuilder(weld::Widget* pParent, const OUString&
         rUIFile != "cui/ui/macroassigndialog.ui" &&
         rUIFile != "cui/ui/macroassignpage.ui" &&
         rUIFile != "cui/ui/macroselectordialog.ui" &&
+        rUIFile != "cui/ui/namedialog.ui" &&
         rUIFile != "cui/ui/objectnamedialog.ui" &&
         rUIFile != "cui/ui/objecttitledescdialog.ui" &&
         rUIFile != "cui/ui/optjsearchpage.ui" &&
@@ -22336,6 +22340,7 @@ weld::Builder* GtkInstance::CreateBuilder(weld::Widget* pParent, const OUString&
         rUIFile != "modules/BasicIDE/ui/newlibdialog.ui" &&
         rUIFile != "modules/BasicIDE/ui/organizedialog.ui" &&
         rUIFile != "modules/scalc/ui/advancedfilterdialog.ui" &&
+        rUIFile != "modules/scalc/ui/checkwarningdialog.ui" &&
         rUIFile != "modules/scalc/ui/colwidthdialog.ui" &&
         rUIFile != "modules/scalc/ui/consolidatedialog.ui" &&
         rUIFile != "modules/scalc/ui/dataform.ui" &&
@@ -22401,11 +22406,14 @@ weld::Builder* GtkInstance::CreateBuilder(weld::Widget* pParent, const OUString&
         rUIFile != "modules/swriter/ui/exchangedatabases.ui" &&
         rUIFile != "modules/swriter/ui/footendnotedialog.ui" &&
         rUIFile != "modules/swriter/ui/footnotepage.ui" &&
+        rUIFile != "modules/swriter/ui/footnotesendnotestabpage.ui" &&
         rUIFile != "modules/swriter/ui/gotopagedialog.ui" &&
+        rUIFile != "modules/swriter/ui/indentpage.ui" &&
         rUIFile != "modules/swriter/ui/indexentry.ui" &&
         rUIFile != "modules/swriter/ui/insertbookmark.ui" &&
         rUIFile != "modules/swriter/ui/insertbreak.ui" &&
         rUIFile != "modules/swriter/ui/insertfootnote.ui" &&
+        rUIFile != "modules/swriter/ui/insertsectiondialog.ui" &&
         rUIFile != "modules/swriter/ui/inserttable.ui" &&
         rUIFile != "modules/swriter/ui/linenumbering.ui" &&
         rUIFile != "modules/swriter/ui/newuserindexdialog.ui" &&
@@ -22417,6 +22425,7 @@ weld::Builder* GtkInstance::CreateBuilder(weld::Widget* pParent, const OUString&
         rUIFile != "modules/swriter/ui/printoptionspage.ui" &&
         rUIFile != "modules/swriter/ui/renameautotextdialog.ui" &&
         rUIFile != "modules/swriter/ui/renameobjectdialog.ui" &&
+        rUIFile != "modules/swriter/ui/sectionpage.ui" &&
         rUIFile != "modules/swriter/ui/statisticsinfopage.ui" &&
         rUIFile != "modules/swriter/ui/titlepage.ui" &&
         rUIFile != "modules/swriter/ui/watermarkdialog.ui" &&
diff --git a/vcl/unx/gtk4/convert3to4.cxx b/vcl/unx/gtk4/convert3to4.cxx
index 24b67f01e576..2ef37b99c72b 100644
--- a/vcl/unx/gtk4/convert3to4.cxx
+++ b/vcl/unx/gtk4/convert3to4.cxx
@@ -310,23 +310,23 @@ struct ConvertResult
     bool m_bHasVisible;
     bool m_bHasIconSize;
     bool m_bAlwaysShowImage;
-    bool m_bImageAtTop;
     bool m_bUseUnderline;
     bool m_bVertOrientation;
+    GtkPositionType m_eImagePos;
     css::uno::Reference<css::xml::dom::XNode> m_xPropertyLabel;
     css::uno::Reference<css::xml::dom::XNode> m_xPropertyIconName;
 
     ConvertResult(bool bChildCanFocus, bool bHasVisible, bool bHasIconSize, bool bAlwaysShowImage,
-                  bool bImageAtTop, bool bUseUnderline, bool bVertOrientation,
+                  bool bUseUnderline, bool bVertOrientation, GtkPositionType eImagePos,
                   const css::uno::Reference<css::xml::dom::XNode>& rPropertyLabel,
                   const css::uno::Reference<css::xml::dom::XNode>& rPropertyIconName)
         : m_bChildCanFocus(bChildCanFocus)
         , m_bHasVisible(bHasVisible)
         , m_bHasIconSize(bHasIconSize)
         , m_bAlwaysShowImage(bAlwaysShowImage)
-        , m_bImageAtTop(bImageAtTop)
         , m_bUseUnderline(bUseUnderline)
         , m_bVertOrientation(bVertOrientation)
+        , m_eImagePos(eImagePos)
         , m_xPropertyLabel(rPropertyLabel)
         , m_xPropertyIconName(rPropertyIconName)
     {
@@ -343,7 +343,8 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode
 {
     css::uno::Reference<css::xml::dom::XNodeList> xNodeList = xNode->getChildNodes();
     if (!xNodeList.is())
-        return ConvertResult(false, false, false, false, false, false, false, nullptr, nullptr);
+        return ConvertResult(false, false, false, false, false, false, GTK_POS_LEFT, nullptr,
+                             nullptr);
 
     std::vector<css::uno::Reference<css::xml::dom::XNode>> xRemoveList;
 
@@ -352,7 +353,7 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode
     bool bHasVisible = false;
     bool bHasIconSize = false;
     bool bAlwaysShowImage = false;
-    bool bImageAtTop = false;
+    GtkPositionType eImagePos = GTK_POS_LEFT;
     bool bUseUnderline = false;
     bool bVertOrientation = false;
     css::uno::Reference<css::xml::dom::XNode> xPropertyLabel;
@@ -501,9 +502,7 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode
                         auto xIconSize = CreateProperty(xDoc, "icon-size", "2");
                         xChild->getParentNode()->insertBefore(xIconSize, xChild);
                     }
-                    else
-                        SAL_WARN("vcl.gtk", "what should we do with an icon-size of: "
-                                                << xChild->getFirstChild()->getNodeValue());
+
                     xRemoveList.push_back(xChild);
                 }
             }
@@ -557,8 +556,15 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode
                     // we will turn always-show-image into a GtkBox child for
                     // GtkButton and a GtkLabel child for the GtkBox and move
                     // the label property into it.
-                    assert(xChild->getFirstChild()->getNodeValue() == "top");
-                    bImageAtTop = xChild->getFirstChild()->getNodeValue() == "top";
+                    OUString sImagePos = xChild->getFirstChild()->getNodeValue();
+                    if (sImagePos == "top")
+                        eImagePos = GTK_POS_TOP;
+                    else if (sImagePos == "bottom")
+                        eImagePos = GTK_POS_BOTTOM;
+                    else if (sImagePos == "right")
+                        eImagePos = GTK_POS_RIGHT;
+                    else
+                        assert(sImagePos == "left");
                     xRemoveList.push_back(xChild);
                 }
             }
@@ -921,7 +927,7 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode
         bool bChildHasIconSize = false;
         bool bChildHasVisible = false;
         bool bChildAlwaysShowImage = false;
-        bool bChildImageAtTop = false;
+        GtkPositionType eChildImagePos = GTK_POS_LEFT;
         bool bChildUseUnderline = false;
         bool bChildVertOrientation = false;
         css::uno::Reference<css::xml::dom::XNode> xChildPropertyLabel;
@@ -940,7 +946,7 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode
                 bChildHasVisible = aChildRes.m_bHasVisible;
                 bChildHasIconSize = aChildRes.m_bHasIconSize;
                 bChildAlwaysShowImage = aChildRes.m_bAlwaysShowImage;
-                bChildImageAtTop = aChildRes.m_bImageAtTop;
+                eChildImagePos = aChildRes.m_eImagePos;
                 bChildUseUnderline = aChildRes.m_bUseUnderline;
                 bChildVertOrientation = aChildRes.m_bVertOrientation;
                 xChildPropertyLabel = aChildRes.m_xPropertyLabel;
@@ -1262,7 +1268,7 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode
                 xBoxClassName->setValue("GtkBox");
                 xNewObjectNode->setAttributeNode(xBoxClassName);
 
-                if (bChildImageAtTop)
+                if (eChildImagePos == GTK_POS_TOP || eChildImagePos == GTK_POS_BOTTOM)
                 {
                     auto xOrientation = CreateProperty(xDoc, "orientation", "vertical");
                     xNewObjectNode->appendChild(xOrientation);
@@ -1300,9 +1306,18 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode
                 }
                 xNewLabelChildNode->appendChild(xNewChildObjectNode);
 
-                if (xImageCandidateNode)
-                    xNewObjectNode->appendChild(xImageCandidateNode);
-                xNewObjectNode->appendChild(xNewLabelChildNode);
+                if (eChildImagePos == GTK_POS_LEFT || eChildImagePos == GTK_POS_TOP)
+                {
+                    if (xImageCandidateNode)
+                        xNewObjectNode->appendChild(xImageCandidateNode);
+                    xNewObjectNode->appendChild(xNewLabelChildNode);
+                }
+                else
+                {
+                    xNewObjectNode->appendChild(xNewLabelChildNode);
+                    if (xImageCandidateNode)
+                        xNewObjectNode->appendChild(xImageCandidateNode);
+                }
             }
         }
 
@@ -1325,8 +1340,8 @@ ConvertResult Convert3To4(const css::uno::Reference<css::xml::dom::XNode>& xNode
         g_free(pText);
     }
 
-    return ConvertResult(bChildCanFocus, bHasVisible, bHasIconSize, bAlwaysShowImage, bImageAtTop,
-                         bUseUnderline, bVertOrientation, xPropertyLabel, xPropertyIconName);
+    return ConvertResult(bChildCanFocus, bHasVisible, bHasIconSize, bAlwaysShowImage, bUseUnderline,
+                         bVertOrientation, eImagePos, xPropertyLabel, xPropertyIconName);
 }
 }
 
commit 72e0b04d23857f873855073605314c912f449801
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jun 15 17:36:54 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jun 16 09:53:21 2021 +0200

    replace deprecated GtkButtonBox
    
    replace the ones outside action-area of dialogs
    
    Change-Id: Iec0edfc675057f994c188e12dbacbb0f2126dbd6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117274
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/uiconfig/ui/areatabpage.ui b/cui/uiconfig/ui/areatabpage.ui
index 37a5d6e04f84..52ae583c9e8c 100644
--- a/cui/uiconfig/ui/areatabpage.ui
+++ b/cui/uiconfig/ui/areatabpage.ui
@@ -18,13 +18,14 @@
         <property name="orientation">vertical</property>
         <property name="spacing">3</property>
         <child>
-          <object class="GtkButtonBox" id="buttonbox1">
+          <object class="GtkBox" id="buttonbox1">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
+            <property name="halign">center</property>
             <property name="margin-top">3</property>
             <property name="hexpand">True</property>
             <property name="spacing">12</property>
-            <property name="layout-style">center</property>
+            <property name="homogeneous">True</property>
             <child>
               <object class="GtkComboBoxText" id="tablelb">
                 <property name="can-focus">False</property>
commit 5ea407ff526c914d83e40f61021a69ad3567f7d9
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jun 15 17:34:41 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jun 16 09:52:11 2021 +0200

    resave with latest glade
    
    Change-Id: I53a401a096e171b0955303396eccda18e1b8002a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117273
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/uiconfig/ui/areatabpage.ui b/cui/uiconfig/ui/areatabpage.ui
index 9296a5b6cf6f..37a5d6e04f84 100644
--- a/cui/uiconfig/ui/areatabpage.ui
+++ b/cui/uiconfig/ui/areatabpage.ui
@@ -1,18 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.36.0 -->
+<!-- Generated with glade 3.38.2 -->
 <interface domain="cui">
   <requires lib="gtk+" version="3.20"/>
   <object class="GtkBox" id="AreaTabPage">
     <property name="visible">True</property>
-    <property name="can_focus">False</property>
+    <property name="can-focus">False</property>
     <property name="hexpand">True</property>
     <property name="vexpand">True</property>
-    <property name="border_width">6</property>
+    <property name="border-width">6</property>
     <property name="spacing">6</property>
     <child>
       <object class="GtkBox" id="box1">
         <property name="visible">True</property>
-        <property name="can_focus">False</property>
+        <property name="can-focus">False</property>
         <property name="hexpand">True</property>
         <property name="vexpand">True</property>
         <property name="orientation">vertical</property>
@@ -20,14 +20,14 @@
         <child>
           <object class="GtkButtonBox" id="buttonbox1">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="margin_top">3</property>
+            <property name="can-focus">False</property>
+            <property name="margin-top">3</property>
             <property name="hexpand">True</property>
             <property name="spacing">12</property>
-            <property name="layout_style">center</property>
+            <property name="layout-style">center</property>
             <child>
               <object class="GtkComboBoxText" id="tablelb">
-                <property name="can_focus">False</property>
+                <property name="can-focus">False</property>
                 <property name="active">0</property>
                 <items>
                   <item id="cellid" translatable="yes" context="areatabpage|tablelb">Cell</item>
@@ -50,8 +50,8 @@
               <object class="GtkToggleButton" id="btnnone">
                 <property name="label" translatable="yes" context="areatabpage|btnnone">None</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="receives-default">True</property>
                 <child internal-child="accessible">
                   <object class="AtkObject" id="btnnone-atkobject">
                     <property name="AtkObject::accessible-description" translatable="yes" context="areatabpage|extended_tip|btnnone">Do not fill the selected object.</property>
@@ -68,8 +68,8 @@
               <object class="GtkToggleButton" id="btncolor">
                 <property name="label" translatable="yes" context="areatabpage|btncolor">Color</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="receives-default">True</property>
                 <child internal-child="accessible">
                   <object class="AtkObject" id="btncolor-atkobject">
                     <property name="AtkObject::accessible-description" translatable="yes" context="areatabpage|extended_tip|btncolor">Fills the object with a color selected on this page.</property>
@@ -86,8 +86,8 @@
               <object class="GtkToggleButton" id="btngradient">
                 <property name="label" translatable="yes" context="areatabpage|btngradient">Gradient</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="receives-default">True</property>
                 <child internal-child="accessible">
                   <object class="AtkObject" id="btngradient-atkobject">
                     <property name="AtkObject::accessible-description" translatable="yes" context="areatabpage|extended_tip|btngradient">Fills the object with a gradient selected on this page.</property>
@@ -104,8 +104,8 @@
               <object class="GtkToggleButton" id="btnbitmap">
                 <property name="label" translatable="yes" context="areatabpage|btnbitmap">Bitmap</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="receives-default">True</property>
                 <child internal-child="accessible">
                   <object class="AtkObject" id="btnbitmap-atkobject">
                     <property name="AtkObject::accessible-description" translatable="yes" context="areatabpage|extended_tip|btnbitmap">Fills the object with a bitmap image selected on this page.</property>
@@ -122,8 +122,8 @@
               <object class="GtkToggleButton" id="btnpattern">
                 <property name="label" translatable="yes" context="areatabpage|btnpattern">Pattern</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="receives-default">True</property>
                 <child internal-child="accessible">
                   <object class="AtkObject" id="btnpattern-atkobject">
                     <property name="AtkObject::accessible-description" translatable="yes" context="areatabpage|extended_tip|btnpattern">Fills the object with a dot pattern selected on this page.</property>
@@ -140,8 +140,8 @@
               <object class="GtkToggleButton" id="btnhatch">
                 <property name="label" translatable="yes" context="areatabpage|btnhatch">Hatch</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="receives-default">True</property>
                 <child internal-child="accessible">
                   <object class="AtkObject" id="btnhatch-atkobject">
                     <property name="AtkObject::accessible-description" translatable="yes" context="areatabpage|extended_tip|btnhatch">Fills the object with a hatching pattern selected on this page.</property>
@@ -164,7 +164,7 @@
         <child>
           <object class="GtkSeparator" id="separator1">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
+            <property name="can-focus">False</property>
           </object>
           <packing>
             <property name="expand">False</property>
@@ -175,7 +175,7 @@
         <child>
           <object class="GtkBox" id="fillstylebox">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
+            <property name="can-focus">False</property>
             <property name="hexpand">True</property>
             <property name="vexpand">True</property>
             <property name="orientation">vertical</property>


More information about the Libreoffice-commits mailing list