widget theme - update combobox/listbox, draw from svg

Change-Id: Ie5e28883d70ad61340c58bcacd8c2ffb2ced1536
Reviewed-on: https://gerrit.libreoffice.org/68865
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This commit is contained in:
Tomaž Vajngerl
2019-03-07 14:10:24 +01:00
committed by Tomaž Vajngerl
parent 79b9d3875f
commit ce4c486456
7 changed files with 80 additions and 26 deletions

View File

@@ -32,6 +32,8 @@ $(eval $(call gb_Package_add_files,vcl_theme_definitions,$(LIBO_SHARE_FOLDER)/th
spinbox-right-rollover.svgx \
spinbox-right-disabled.svgx \
spinbox-entire.svgx \
common-rect.svgx \
common-rect-disabled.svgx \
pushbutton-default.svgx \
pushbutton-rollover.svgx \
tabitem-first.svgx \
@@ -42,6 +44,8 @@ $(eval $(call gb_Package_add_files,vcl_theme_definitions,$(LIBO_SHARE_FOLDER)/th
tabitem-last-selected.svgx \
scrollbar-horizontal.svgx \
scrollbar-vertical.svgx \
combobox.svgx \
combobox-disabled.svgx \
))
# vim: set noet sw=4 ts=4:

View File

@@ -723,6 +723,40 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion(
}
}
break;
case ControlType::Combobox:
case ControlType::Listbox:
{
auto const& pPart = m_aWidgetDefinition.getDefinition(eType, ControlPart::ButtonDown);
Size aComboButtonSize(pPart->mnWidth, pPart->mnHeight);
if (ePart == ControlPart::ButtonDown)
{
Point aPoint(aLocation.X() + rBoundingControlRegion.GetWidth()
- aComboButtonSize.Width(),
aLocation.Y());
rNativeContentRegion = tools::Rectangle(aPoint, aComboButtonSize);
rNativeBoundingRegion = rNativeContentRegion;
return true;
}
else if (ePart == ControlPart::SubEdit)
{
Size aSize(rBoundingControlRegion.GetWidth() - aComboButtonSize.Width(),
aComboButtonSize.Height());
rNativeContentRegion = tools::Rectangle(aLocation, aSize);
rNativeContentRegion.expand(1);
rNativeBoundingRegion = rNativeContentRegion;
return true;
}
else if (ePart == ControlPart::Entire)
{
Size aSize(rBoundingControlRegion.GetWidth(), aComboButtonSize.Height());
rNativeContentRegion = tools::Rectangle(aLocation, aSize);
rNativeBoundingRegion = rNativeContentRegion;
rNativeBoundingRegion.expand(1);
return true;
}
}
break;
default:
break;

View File

@@ -0,0 +1,4 @@
<svg version="1.1" viewBox="0 0 35 36" xmlns="http://www.w3.org/2000/svg">
<path d="m6.8098e-4 -4e-7v1.2272l-6.8092e-4 33.546v1.2272h33.75c0.68524 0 1.2499-0.55442 1.2499-1.2272v-33.546c0-0.67283-0.56468-1.2272-1.2499-1.2272z" fill="#8e8e93"/>
<path d="m17.5 19.091-4.6667-5.0907-1.3333 1.4546 6 6.5454 6-6.5454-1.3333-1.4546z" fill="#f5f5f5"/>
</svg>

After

Width:  |  Height:  |  Size: 354 B

View File

@@ -0,0 +1,4 @@
<svg version="1.1" viewBox="0 0 35 36" xmlns="http://www.w3.org/2000/svg">
<path d="m6.8098e-4 -4e-7v1.2272l-6.8092e-4 33.546v1.2272h33.75c0.68524 0 1.2499-0.55442 1.2499-1.2272v-33.546c0-0.67283-0.56468-1.2272-1.2499-1.2272z" fill="#0273f8"/>
<path d="m17.5 19.091-4.6667-5.0907-1.3333 1.4546 6 6.5454 6-6.5454-1.3333-1.4546z" fill="#f5f5f5"/>
</svg>

After

Width:  |  Height:  |  Size: 354 B

View File

@@ -0,0 +1,3 @@
<svg version="1.1" viewBox="0 0 44 26" xmlns="http://www.w3.org/2000/svg">
<rect x=".5" y=".5" width="43" height="25" rx="2" ry="2" fill="#fff" stroke="#8e8e93"/>
</svg>

After

Width:  |  Height:  |  Size: 171 B

View File

@@ -0,0 +1,3 @@
<svg version="1.1" viewBox="0 0 44 26" xmlns="http://www.w3.org/2000/svg">
<rect x=".5" y=".5" width="43" height="25" rx="2" ry="2" fill="#fff" stroke="#007aff"/>
</svg>

After

Width:  |  Height:  |  Size: 171 B

View File

@@ -124,24 +124,24 @@
<combobox>
<part value="Entire">
<state>
<external source="spinbox-entire.svgx" />
<state enabled="true">
<external source="common-rect.svgx" />
</state>
<state enabled="false">
<external source="common-rect-disabled.svgx" />
</state>
</part>
<part value="SubEdit">
<state>
</state>
</part>
<part value="ButtonUp">
<state>
<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"/>
<part value="ButtonDown" width="35" height="36">
<state enabled="true">
<image source="combobox.svgx" />
</state>
</part>
<part value="ButtonDown">
<state>
<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 enabled="false">
<image source="combobox-disabled.svgx" />
</state>
</part>
</combobox>
@@ -157,8 +157,11 @@
<listbox>
<part value="Entire">
<state>
<rect stroke="#007AFF" fill="#FFFFFF" stroke-width="1" rx="1" ry="1" />
<state enabled="true">
<external source="common-rect.svgx" />
</state>
<state enabled="false">
<external source="common-rect-disabled.svgx" />
</state>
</part>
<part value="ListboxWindow">
@@ -166,21 +169,20 @@
<rect stroke="#007AFF" fill="#FFFFFF" stroke-width="1" rx="1" ry="1" />
</state>
</part>
<part value="SubEdit">
<state>
</state>
</part>
<part value="ButtonDown" width="35" height="36">
<state enabled="true">
<image source="combo.svgx" />
</state>
<state enabled="false">
<image source="combo-disabled.svgx" />
</state>
</part>
<part value="Focus">
<state>
<rect stroke="#007AFF" fill="#FFFFFF" stroke-width="1" rx="1" ry="1" />
</state>
</part>
<part value="ButtonUp">
<state>
<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>
<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>