[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - vcl/source

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Thu May 23 11:37:05 UTC 2019


 vcl/source/gdi/FileDefinitionWidgetDraw.cxx |    8 +++++---
 vcl/source/gdi/WidgetDefinitionReader.cxx   |    6 ++++++
 2 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 544fdb89fa2152d6283825f88856ea5216d4e854
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon May 20 21:41:03 2019 +0900
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu May 23 13:36:18 2019 +0200

    widgettheme: support multiple spinbox orientations
    
    This adds the ability to define the spinbox orientation that has
    decrease and increase buttons on the right side and can be changed
    by adding "orientation="edit-decrease-increase" to the Spinbox
    "Entire" part in the widget definition.
    
    Change-Id: I3601a987a4abb8d998e9cd2d8973d794d3d66f9b
    Reviewed-on: https://gerrit.libreoffice.org/72662
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    (cherry picked from commit 3b67ad5f11714d6bea83ec8511f7723dbd999c56)
    Reviewed-on: https://gerrit.libreoffice.org/72823
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Tested-by: Tor Lillqvist <tml at collabora.com>

diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index 9e84edc2ba3e..52affa9326f9 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -689,9 +689,11 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion(
                 return false;
             Size aButtonSizeDown(pButtonDownPart->mnWidth, pButtonDownPart->mnHeight);
 
-            OString sOrientation = "decrease-edit-increase";
+            auto const& pEntirePart
+                = m_pWidgetDefinition->getDefinition(eType, ControlPart::Entire);
+            OString sOrientation = pEntirePart->msOrientation;
 
-            if (sOrientation == "decrease-edit-increase")
+            if (sOrientation.isEmpty() || sOrientation == "decrease-edit-increase")
             {
                 if (ePart == ControlPart::ButtonUp)
                 {
@@ -727,7 +729,7 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion(
                     return true;
                 }
             }
-            else
+            else if (sOrientation == "edit-decrease-increase")
             {
                 if (ePart == ControlPart::ButtonUp)
                 {
diff --git a/vcl/source/gdi/WidgetDefinitionReader.cxx b/vcl/source/gdi/WidgetDefinitionReader.cxx
index f825addd0042..dd6bf75abe32 100644
--- a/vcl/source/gdi/WidgetDefinitionReader.cxx
+++ b/vcl/source/gdi/WidgetDefinitionReader.cxx
@@ -308,6 +308,12 @@ void WidgetDefinitionReader::readDefinition(tools::XmlWalker& rWalker,
                 pPart->mnMarginWidth = nMarginWidth;
             }
 
+            OString sOrientation = rWalker.attribute("orientation");
+            if (!sOrientation.isEmpty())
+            {
+                pPart->msOrientation = sOrientation;
+            }
+
             rWidgetDefinition.maDefinitions.emplace(ControlTypeAndPart(eType, ePart), pPart);
             readPart(rWalker, pPart);
         }


More information about the Libreoffice-commits mailing list