Draw basic listbox from the theme definition

Change-Id: Id3dd5aaa8b5537e5f740752cec292d6f4a44044e
Reviewed-on: https://gerrit.libreoffice.org/68771
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This commit is contained in:
Tomaž Vajngerl
2019-03-02 23:24:13 +01:00
committed by Tomaž Vajngerl
parent 7894fd2b44
commit 734a5cc1eb
3 changed files with 43 additions and 7 deletions

View File

@@ -69,7 +69,9 @@ bool FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, Contr
case ControlType::MultilineEditbox:
return true;
case ControlType::Listbox:
return false;
if (ePart == ControlPart::HasBackgroundTexture)
return false;
return true;
case ControlType::Spinbox:
if (ePart == ControlPart::AllButtons)
return false;
@@ -290,7 +292,10 @@ bool FileDefinitionWidgetDraw::drawNativeControl(ControlType eType, ControlPart
}
break;
case ControlType::Listbox:
break;
{
bOK = resolveDefinition(eType, ePart, eState, rValue, nX, nY, nWidth, nHeight);
}
break;
case ControlType::Spinbox:
{
if (rValue.getType() == ControlType::SpinButtons)

View File

@@ -135,11 +135,12 @@ 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 }, { "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 } };
{ "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 } };
auto const& rIterator = aPartMap.find(rString);
if (rIterator != aPartMap.end())

View File

@@ -140,6 +140,36 @@
</part>
</editbox>
<listbox>
<part value="Entire">
<state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
<rect stroke="#007AFF" fill="#FFFFFF" stroke-width="1" rx="1" ry="1" />
</state>
</part>
<part value="ListboxWindow">
<state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
<rect stroke="#007AFF" fill="#FFFFFF" stroke-width="1" rx="1" ry="1" />
</state>
</part>
<part value="Focus">
<state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
<rect stroke="#007AFF" fill="#FFFFFF" stroke-width="1" rx="1" ry="1" />
</state>
</part>
<part value="ButtonUp">
<state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">
<line stroke="#007AFF" stroke-width="4" x1="0.2" y1="0.6" x2="0.5" y2="0.4"/>
<line stroke="#007AFF" 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="#007AFF" stroke-width="4" x1="0.2" y1="0.4" x2="0.5" y2="0.6"/>
<line stroke="#007AFF" stroke-width="4" x1="0.5" y1="0.6" x2="0.8" y2="0.4"/>
</state>
</part>
</listbox>
<spinbox>
<part value="Entire">
<state enabled="any" focused="any" pressed="any" rollover="any" default="any" selected="any" button-value="any">