[Libreoffice-commits] core.git: vcl/source vcl/uiconfig

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Mar 5 19:24:59 UTC 2019


 vcl/source/gdi/FileDefinitionWidgetDraw.cxx   |   21 ++++++++++++++++++++-
 vcl/source/gdi/WidgetDefinitionReader.cxx     |    2 +-
 vcl/uiconfig/theme_definitions/definition.xml |    8 ++++++++
 3 files changed, 29 insertions(+), 2 deletions(-)

New commits:
commit 5c124597d0446bbb7cb0672a6335ebcd68520e00
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Feb 19 14:21:42 2019 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Tue Mar 5 20:24:32 2019 +0100

    Draw basic progress from the theme definition
    
    Change-Id: If2c6f434dd64cf1b3bab340dc6c4d73f439bcfdf
    Reviewed-on: https://gerrit.libreoffice.org/68751
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index 14477ef40ec5..7fa086bbd854 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -87,8 +87,10 @@ bool FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, Contr
         case ControlType::Toolbar:
         case ControlType::Menubar:
         case ControlType::MenuPopup:
+            return false;
         case ControlType::Progress:
         case ControlType::IntroProgress:
+            return true;
         case ControlType::Tooltip:
         case ControlType::WindowBackground:
         case ControlType::Frame:
@@ -478,7 +480,24 @@ bool FileDefinitionWidgetDraw::drawNativeControl(ControlType eType, ControlPart
             break;
         case ControlType::Progress:
         case ControlType::IntroProgress:
-            break;
+        {
+            std::shared_ptr<WidgetDefinitionPart> pPart
+                = m_aWidgetDefinition.getDefinition(eType, ePart);
+            if (pPart)
+            {
+                auto aStates = pPart->getStates(eState, rValue);
+                if (!aStates.empty())
+                {
+                    std::shared_ptr<WidgetDefinitionState> pState = aStates.back();
+                    {
+                        munchDrawCommands(pState->mpDrawCommands, m_rGraphics, nX, nY, nWidth,
+                                          nHeight);
+                        bOK = true;
+                    }
+                }
+            }
+        }
+        break;
         case ControlType::Tooltip:
             break;
         case ControlType::WindowBackground:
diff --git a/vcl/source/gdi/WidgetDefinitionReader.cxx b/vcl/source/gdi/WidgetDefinitionReader.cxx
index 8be78889e990..3d210b1d88cd 100644
--- a/vcl/source/gdi/WidgetDefinitionReader.cxx
+++ b/vcl/source/gdi/WidgetDefinitionReader.cxx
@@ -137,7 +137,7 @@ bool getControlTypeForXmlString(OString const& rString, ControlType& reType)
             { "checkbox", ControlType::Checkbox },     { "combobox", ControlType::Combobox },
             { "editbox", ControlType::Editbox },       { "scrollbar", ControlType::Scrollbar },
             { "spinbox", ControlType::Spinbox },       { "slider", ControlType::Slider },
-            { "fixedline", ControlType::Fixedline } };
+            { "fixedline", ControlType::Fixedline },   { "progress", ControlType::Progress } };
 
     auto const& rIterator = aPartMap.find(rString);
     if (rIterator != aPartMap.end())
diff --git a/vcl/uiconfig/theme_definitions/definition.xml b/vcl/uiconfig/theme_definitions/definition.xml
index 8adfc76ae6b1..8aa959ab314e 100644
--- a/vcl/uiconfig/theme_definitions/definition.xml
+++ b/vcl/uiconfig/theme_definitions/definition.xml
@@ -214,4 +214,12 @@
         </part>
     </fixedline>
 
+    <progress>
+        <part value="Entire">
+            <state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
+                <rect stroke="#007AFF" fill="#007AFF" stroke-width="1" rx="7" ry="7"/>
+            </state>
+        </part>
+    </progress>
+
 </widgets>


More information about the Libreoffice-commits mailing list