From 16d9cfe92a60e3a7ea238ef4a656e5277231b866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Tue, 19 Feb 2019 14:17:54 +0100 Subject: [PATCH] Draw basic fixedline from the theme definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I791d33e4cea14f49609434e39f681cf47864fc67 Reviewed-on: https://gerrit.libreoffice.org/68750 Reviewed-by: Tomaž Vajngerl Tested-by: Tomaž Vajngerl --- vcl/source/gdi/FileDefinitionWidgetDraw.cxx | 20 ++++++++++++++++++- vcl/source/gdi/WidgetDefinitionReader.cxx | 3 ++- vcl/uiconfig/theme_definitions/definition.xml | 13 ++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx index 317cb3455641..14477ef40ec5 100644 --- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx +++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx @@ -82,8 +82,8 @@ bool FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, Contr return false; return true; case ControlType::Slider: - return true; case ControlType::Fixedline: + return true; case ControlType::Toolbar: case ControlType::Menubar: case ControlType::MenuPopup: @@ -453,6 +453,24 @@ bool FileDefinitionWidgetDraw::drawNativeControl(ControlType eType, ControlPart } break; case ControlType::Fixedline: + { + std::shared_ptr pPart + = m_aWidgetDefinition.getDefinition(eType, ePart); + if (pPart) + { + auto aStates = pPart->getStates(eState, rValue); + if (!aStates.empty()) + { + std::shared_ptr pState = aStates.back(); + { + munchDrawCommands(pState->mpDrawCommands, m_rGraphics, nX, nY, nWidth, + nHeight); + bOK = true; + } + } + } + } + break; case ControlType::Toolbar: case ControlType::Menubar: break; diff --git a/vcl/source/gdi/WidgetDefinitionReader.cxx b/vcl/source/gdi/WidgetDefinitionReader.cxx index 9e4ed46f6f36..8be78889e990 100644 --- a/vcl/source/gdi/WidgetDefinitionReader.cxx +++ b/vcl/source/gdi/WidgetDefinitionReader.cxx @@ -136,7 +136,8 @@ bool getControlTypeForXmlString(OString const& rString, ControlType& reType) = { { "pushbutton", ControlType::Pushbutton }, { "radiobutton", ControlType::Radiobutton }, { "checkbox", ControlType::Checkbox }, { "combobox", ControlType::Combobox }, { "editbox", ControlType::Editbox }, { "scrollbar", ControlType::Scrollbar }, - { "spinbox", ControlType::Spinbox }, { "slider", ControlType::Slider } }; + { "spinbox", ControlType::Spinbox }, { "slider", ControlType::Slider }, + { "fixedline", ControlType::Fixedline } }; 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 e57404c94013..8adfc76ae6b1 100644 --- a/vcl/uiconfig/theme_definitions/definition.xml +++ b/vcl/uiconfig/theme_definitions/definition.xml @@ -201,4 +201,17 @@ + + + + + + + + + + + + +