diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-02-19 14:21:42 +0100 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-08-29 20:10:49 +0900 |
commit | a28f896301c6fc8f6f5966f3a8387c3f9c1a16af (patch) | |
tree | 645b4819dd24d19c9dc2bde7d750b5c11cb729d5 /vcl | |
parent | 58835cd41667bc29ed5dd87700932cad30ae96a3 (diff) |
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@gmail.com>
(cherry picked from commit 5c124597d0446bbb7cb0672a6335ebcd68520e00)
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/FileDefinitionWidgetDraw.cxx | 21 | ||||
-rw-r--r-- | vcl/source/gdi/WidgetDefinitionReader.cxx | 2 | ||||
-rw-r--r-- | vcl/uiconfig/theme_definitions/definition.xml | 8 |
3 files changed, 29 insertions, 2 deletions
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> |