diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-01-29 13:53:48 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-03-04 22:42:00 +0100 |
commit | 394bf64515273985b30f77033c95277b41f021c4 (patch) | |
tree | 159c0ff839a3ac499951f5e5407779bcdbbc1e65 /vcl/source | |
parent | c4378dd23edd70110cada99b97a8df6d6f6d47d2 (diff) |
Draw basic combobox from the theme definition
Change-Id: I2ed631676be878bd5e89872077ab47937aabbf7a
Reviewed-on: https://gerrit.libreoffice.org/68697
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/FileDefinitionWidgetDraw.cxx | 25 | ||||
-rw-r--r-- | vcl/source/gdi/WidgetDefinitionReader.cxx | 5 |
2 files changed, 27 insertions, 3 deletions
diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx index a287f2c0fee7..6681d2190dd2 100644 --- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx +++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx @@ -42,7 +42,7 @@ FileDefinitionWidgetDraw::FileDefinitionWidgetDraw(SalGraphics& rGraphics) pSVData->maNWFData.mbNoFocusRectsForFlatButtons = true; } -bool FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, ControlPart /*ePart*/) +bool FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, ControlPart ePart) { switch (eType) { @@ -52,7 +52,9 @@ bool FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, Contr case ControlType::Checkbox: return true; case ControlType::Combobox: - return false; + if (ePart == ControlPart::HasBackgroundTexture) + return false; + return true; case ControlType::Editbox: case ControlType::EditboxNoBorder: case ControlType::MultilineEditbox: @@ -248,7 +250,21 @@ bool FileDefinitionWidgetDraw::drawNativeControl(ControlType eType, ControlPart } break; case ControlType::Combobox: - 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::Editbox: case ControlType::EditboxNoBorder: case ControlType::MultilineEditbox: @@ -309,6 +325,9 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion( case ControlType::Checkbox: rNativeContentRegion = tools::Rectangle(Point(), Size(48, 32)); return true; + case ControlType::Radiobutton: + rNativeContentRegion = tools::Rectangle(Point(), Size(32, 32)); + return true; default: break; } diff --git a/vcl/source/gdi/WidgetDefinitionReader.cxx b/vcl/source/gdi/WidgetDefinitionReader.cxx index 40dcbcee45bb..f37385cc09b9 100644 --- a/vcl/source/gdi/WidgetDefinitionReader.cxx +++ b/vcl/source/gdi/WidgetDefinitionReader.cxx @@ -153,6 +153,11 @@ bool getControlTypeForXmlString(OString const& rString, ControlType& reType) reType = ControlType::Checkbox; bReturn = true; } + else if (rString == "combobox") + { + reType = ControlType::Combobox; + bReturn = true; + } return bReturn; } |