Kaydet (Commit) 917ca882 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

Draw basic tabbar widgets from the theme definition

Change-Id: I51f8868abff3f3e38bd70ea1fc99a9cf5aca92a6
Reviewed-on: https://gerrit.libreoffice.org/68752
Tested-by: Jenkins
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst a1eaf6a4
...@@ -45,6 +45,10 @@ FileDefinitionWidgetDraw::FileDefinitionWidgetDraw(SalGraphics& rGraphics) ...@@ -45,6 +45,10 @@ FileDefinitionWidgetDraw::FileDefinitionWidgetDraw(SalGraphics& rGraphics)
ImplSVData* pSVData = ImplGetSVData(); ImplSVData* pSVData = ImplGetSVData();
pSVData->maNWFData.mbNoFocusRects = true; pSVData->maNWFData.mbNoFocusRects = true;
pSVData->maNWFData.mbNoFocusRectsForFlatButtons = 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) bool FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, ControlPart ePart)
...@@ -71,11 +75,12 @@ bool FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, Contr ...@@ -71,11 +75,12 @@ bool FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, Contr
return false; return false;
return true; return true;
case ControlType::SpinButtons: case ControlType::SpinButtons:
return false;
case ControlType::TabItem: case ControlType::TabItem:
case ControlType::TabPane: case ControlType::TabPane:
case ControlType::TabHeader: case ControlType::TabHeader:
case ControlType::TabBody: case ControlType::TabBody:
return false; return true;
case ControlType::Scrollbar: case ControlType::Scrollbar:
if (ePart == ControlPart::DrawBackgroundHorz if (ePart == ControlPart::DrawBackgroundHorz
|| ePart == ControlPart::DrawBackgroundVert) || ePart == ControlPart::DrawBackgroundVert)
...@@ -402,9 +407,15 @@ bool FileDefinitionWidgetDraw::drawNativeControl(ControlType eType, ControlPart ...@@ -402,9 +407,15 @@ bool FileDefinitionWidgetDraw::drawNativeControl(ControlType eType, ControlPart
} }
break; break;
case ControlType::SpinButtons: case ControlType::SpinButtons:
break;
case ControlType::TabItem: case ControlType::TabItem:
case ControlType::TabHeader:
case ControlType::TabPane: case ControlType::TabPane:
case ControlType::TabBody: case ControlType::TabBody:
{
bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
}
break;
case ControlType::Scrollbar: case ControlType::Scrollbar:
{ {
bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight); bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
...@@ -568,6 +579,14 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion( ...@@ -568,6 +579,14 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion(
case ControlType::Radiobutton: case ControlType::Radiobutton:
rNativeContentRegion = tools::Rectangle(Point(), Size(32, 32)); rNativeContentRegion = tools::Rectangle(Point(), Size(32, 32));
return true; return true;
case ControlType::TabItem:
{
rNativeBoundingRegion = tools::Rectangle(rBoundingControlRegion.TopLeft(),
Size(rBoundingControlRegion.GetWidth() + 20,
rBoundingControlRegion.GetHeight() + 6));
rNativeContentRegion = rNativeBoundingRegion;
return true;
}
default: default:
break; break;
} }
......
...@@ -137,7 +137,9 @@ bool getControlTypeForXmlString(OString const& rString, ControlType& reType) ...@@ -137,7 +137,9 @@ bool getControlTypeForXmlString(OString const& rString, ControlType& reType)
{ "checkbox", ControlType::Checkbox }, { "combobox", ControlType::Combobox }, { "checkbox", ControlType::Checkbox }, { "combobox", ControlType::Combobox },
{ "editbox", ControlType::Editbox }, { "scrollbar", ControlType::Scrollbar }, { "editbox", ControlType::Editbox }, { "scrollbar", ControlType::Scrollbar },
{ "spinbox", ControlType::Spinbox }, { "slider", ControlType::Slider }, { "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); auto const& rIterator = aPartMap.find(rString);
if (rIterator != aPartMap.end()) if (rIterator != aPartMap.end())
......
...@@ -222,4 +222,39 @@ ...@@ -222,4 +222,39 @@
</part> </part>
</progress> </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> </widgets>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment