summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-03-02 23:30:42 +0100
committerTomaž Vajngerl <quikee@gmail.com>2019-03-06 16:33:38 +0100
commitc28104e0c2e030b52bb39276421da8da2e28f669 (patch)
treed8ce817edbaa91b8d8c5ea886ff259f38352ae85 /vcl
parent734a5cc1eba1bbfafcd93f09177ff07b52fa95f8 (diff)
Draw basic frame and window background from the theme definition
Change-Id: I2422650a155a874855ad4d72fa3bfd27b7d0da8a Reviewed-on: https://gerrit.libreoffice.org/68772 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/FileDefinitionWidgetDraw.cxx6
-rw-r--r--vcl/source/gdi/WidgetDefinitionReader.cxx25
-rw-r--r--vcl/uiconfig/theme_definitions/definition.xml25
3 files changed, 48 insertions, 8 deletions
diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index b88ac38b5f64..10b4643f5de8 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -99,8 +99,10 @@ bool FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, Contr
case ControlType::IntroProgress:
return true;
case ControlType::Tooltip:
+ return false;
case ControlType::WindowBackground:
case ControlType::Frame:
+ return true;
case ControlType::ListNode:
case ControlType::ListNet:
case ControlType::ListHeader:
@@ -391,6 +393,10 @@ bool FileDefinitionWidgetDraw::drawNativeControl(ControlType eType, ControlPart
break;
case ControlType::WindowBackground:
case ControlType::Frame:
+ {
+ bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
+ }
+ break;
case ControlType::ListNode:
case ControlType::ListNet:
case ControlType::ListHeader:
diff --git a/vcl/source/gdi/WidgetDefinitionReader.cxx b/vcl/source/gdi/WidgetDefinitionReader.cxx
index 84740bced4a2..997ba931ebf0 100644
--- a/vcl/source/gdi/WidgetDefinitionReader.cxx
+++ b/vcl/source/gdi/WidgetDefinitionReader.cxx
@@ -133,14 +133,23 @@ ControlPart xmlStringToControlPart(OString const& sPart)
bool getControlTypeForXmlString(OString const& rString, ControlType& reType)
{
static std::unordered_map<OString, ControlType> aPartMap
- = { { "pushbutton", ControlType::Pushbutton }, { "radiobutton", ControlType::Radiobutton },
- { "checkbox", ControlType::Checkbox }, { "combobox", ControlType::Combobox },
- { "editbox", ControlType::Editbox }, { "listbox", ControlType::Listbox },
- { "scrollbar", ControlType::Scrollbar }, { "spinbox", ControlType::Spinbox },
- { "slider", ControlType::Slider }, { "fixedline", ControlType::Fixedline },
- { "progress", ControlType::Progress }, { "tabitem", ControlType::TabItem },
- { "tabheader", ControlType::TabHeader }, { "tabpane", ControlType::TabPane },
- { "tabbody", ControlType::TabBody } };
+ = { { "pushbutton", ControlType::Pushbutton },
+ { "radiobutton", ControlType::Radiobutton },
+ { "checkbox", ControlType::Checkbox },
+ { "combobox", ControlType::Combobox },
+ { "editbox", ControlType::Editbox },
+ { "listbox", ControlType::Listbox },
+ { "scrollbar", ControlType::Scrollbar },
+ { "spinbox", ControlType::Spinbox },
+ { "slider", ControlType::Slider },
+ { "fixedline", ControlType::Fixedline },
+ { "progress", ControlType::Progress },
+ { "tabitem", ControlType::TabItem },
+ { "tabheader", ControlType::TabHeader },
+ { "tabpane", ControlType::TabPane },
+ { "tabbody", ControlType::TabBody },
+ { "frame", ControlType::Frame },
+ { "windowbackground", ControlType::WindowBackground } };
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 c9cdfd63605c..36ddb0402805 100644
--- a/vcl/uiconfig/theme_definitions/definition.xml
+++ b/vcl/uiconfig/theme_definitions/definition.xml
@@ -310,4 +310,29 @@
</part>
</tabbody>
+ <windowbackground>
+ <part value="BackgroundWindow">
+ <state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
+ <rect stroke="#FF0000" fill="#FF0000" stroke-width="1" rx="1" ry="1"/>
+ </state>
+ </part>
+ <part value="BackgroundDialog">
+ <state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
+ <rect stroke="#0000FF" fill="#FFFFFF" stroke-width="1" rx="1" ry="1"/>
+ </state>
+ </part>
+ </windowbackground>
+
+ <frame>
+ <part value="Entire">
+ <state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
+ <rect stroke="#00FF00" fill="#00FF00" stroke-width="1" rx="1" ry="1"/>
+ </state>
+ </part>
+ <part value="Border">
+ <state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
+ <rect stroke="#00FF00" fill="#00FF00" stroke-width="1" rx="1" ry="1"/>
+ </state>
+ </part>
+ </frame>
</widgets>