Kaydet (Commit) 394bf645 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

Draw basic combobox from the theme definition

Change-Id: I2ed631676be878bd5e89872077ab47937aabbf7a
Reviewed-on: https://gerrit.libreoffice.org/68697
Tested-by: Jenkins
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst c4378dd2
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -90,6 +90,26 @@
</part>
</checkbox>
<combobox>
<part value="Entire">
<state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
<rect stroke="#4CD964" fill="#FFFFFF" stroke-width="1" rx="5" ry="5" />
</state>
</part>
<part value="ButtonUp">
<state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
<line stroke="#C7C7C7" stroke-width="4" x1="0.2" y1="0.6" x2="0.5" y2="0.4"/>
<line stroke="#C7C7C7" stroke-width="4" x1="0.5" y1="0.4" x2="0.8" y2="0.6"/>
</state>
</part>
<part value="ButtonDown">
<state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
<line stroke="#C7C7C7" stroke-width="4" x1="0.2" y1="0.4" x2="0.5" y2="0.6"/>
<line stroke="#C7C7C7" stroke-width="4" x1="0.5" y1="0.6" x2="0.8" y2="0.4"/>
</state>
</part>
</combobox>
<editbox>
<part value="Entire">
<state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
......
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