summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-02-19 14:26:40 +0100
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-08-29 20:10:49 +0900
commitb3e42feaa543e8a848576efabca6592d22a80358 (patch)
tree82e34c6b2f4dadef46193354e7015585c5a1d8a1 /vcl
parenta28f896301c6fc8f6f5966f3a8387c3f9c1a16af (diff)
Draw basic tabbar widgets from the theme definition
Change-Id: I51f8868abff3f3e38bd70ea1fc99a9cf5aca92a6 Reviewed-on: https://gerrit.libreoffice.org/68752 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 67b6b526dd759d28c554880b2e728ca99c6cce7b)
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/FileDefinitionWidgetDraw.cxx21
-rw-r--r--vcl/source/gdi/WidgetDefinitionReader.cxx4
-rw-r--r--vcl/uiconfig/theme_definitions/definition.xml35
3 files changed, 58 insertions, 2 deletions
diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index 7fa086bbd854..f2db60e4b5f0 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -45,6 +45,10 @@ FileDefinitionWidgetDraw::FileDefinitionWidgetDraw(SalGraphics& rGraphics)
ImplSVData* pSVData = ImplGetSVData();
pSVData->maNWFData.mbNoFocusRects = true;
pSVData->maNWFData.mbNoFocusRectsForFlatButtons = true;
+ pSVData->maNWFData.mbNoActiveTabTextRaise = true;
+ pSVData->maNWFData.mbCenteredTabs = true;
+ pSVData->maNWFData.mbProgressNeedsErase = true;
+ pSVData->maNWFData.mnStatusBarLowerRightOffset = 10;
}
bool FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, ControlPart ePart)
@@ -71,11 +75,12 @@ bool FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, Contr
return false;
return true;
case ControlType::SpinButtons:
+ return false;
case ControlType::TabItem:
case ControlType::TabPane:
case ControlType::TabHeader:
case ControlType::TabBody:
- return false;
+ return true;
case ControlType::Scrollbar:
if (ePart == ControlPart::DrawBackgroundHorz
|| ePart == ControlPart::DrawBackgroundVert)
@@ -402,9 +407,15 @@ bool FileDefinitionWidgetDraw::drawNativeControl(ControlType eType, ControlPart
}
break;
case ControlType::SpinButtons:
+ break;
case ControlType::TabItem:
+ case ControlType::TabHeader:
case ControlType::TabPane:
case ControlType::TabBody:
+ {
+ bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
+ }
+ break;
case ControlType::Scrollbar:
{
bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
@@ -568,6 +579,14 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion(
case ControlType::Radiobutton:
rNativeContentRegion = tools::Rectangle(Point(), Size(32, 32));
return true;
+ case ControlType::TabItem:
+ {
+ rNativeBoundingRegion = tools::Rectangle(rBoundingControlRegion.TopLeft(),
+ Size(rBoundingControlRegion.GetWidth() + 20,
+ rBoundingControlRegion.GetHeight() + 6));
+ rNativeContentRegion = rNativeBoundingRegion;
+ return true;
+ }
default:
break;
}
diff --git a/vcl/source/gdi/WidgetDefinitionReader.cxx b/vcl/source/gdi/WidgetDefinitionReader.cxx
index 3d210b1d88cd..351d0fcdc9ef 100644
--- a/vcl/source/gdi/WidgetDefinitionReader.cxx
+++ b/vcl/source/gdi/WidgetDefinitionReader.cxx
@@ -137,7 +137,9 @@ 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 }, { "progress", ControlType::Progress } };
+ { "fixedline", ControlType::Fixedline }, { "progress", ControlType::Progress },
+ { "tabitem", ControlType::TabItem }, { "tabheader", ControlType::TabHeader },
+ { "tabpane", ControlType::TabPane }, { "tabbody", ControlType::TabBody } };
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 8aa959ab314e..13859cfa3833 100644
--- a/vcl/uiconfig/theme_definitions/definition.xml
+++ b/vcl/uiconfig/theme_definitions/definition.xml
@@ -222,4 +222,39 @@
</part>
</progress>
+ <tabitem>
+ <part value="Entire">
+ <state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="true" button-value="any">
+ <rect stroke="#007AFF" fill="#007AFF" stroke-width="1" rx="1" ry="1"/>
+ </state>
+ <state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="false" button-value="any">
+ <rect stroke="#007AFF" fill="#FFFFFF" stroke-width="1" rx="1" ry="1"/>
+ </state>
+ </part>
+ </tabitem>
+
+ <tabheader>
+ <part value="Entire">
+ <state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
+ <rect stroke="#FF0000" fill="#FFFFFF" stroke-width="1" rx="1" ry="1"/>
+ </state>
+ </part>
+ </tabheader>
+
+ <tabpane>
+ <part value="Entire">
+ <state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
+ <rect stroke="#00FF00" fill="#FFFFFF" stroke-width="1" rx="1" ry="1"/>
+ </state>
+ </part>
+ </tabpane>
+
+ <tabbody>
+ <part value="Entire">
+ <state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
+ <rect stroke="#FFFFFF" fill="#FFFFFF" stroke-width="1" rx="1" ry="1"/>
+ </state>
+ </part>
+ </tabbody>
+
</widgets>