widget theme - update scrollbars, draw from svg

Change-Id: I7e7cd05ce516ab24d380bb8b6a264fd45e1d553c
Reviewed-on: https://gerrit.libreoffice.org/68864
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
This commit is contained in:
Tomaž Vajngerl
2019-03-07 14:00:16 +01:00
committed by Tomaž Vajngerl
parent 767dd751b8
commit 79b9d3875f
5 changed files with 44 additions and 11 deletions

View File

@@ -40,6 +40,8 @@ $(eval $(call gb_Package_add_files,vcl_theme_definitions,$(LIBO_SHARE_FOLDER)/th
tabitem-first-selected.svgx \ tabitem-first-selected.svgx \
tabitem-middle-selected.svgx \ tabitem-middle-selected.svgx \
tabitem-last-selected.svgx \ tabitem-last-selected.svgx \
scrollbar-horizontal.svgx \
scrollbar-vertical.svgx \
)) ))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:

View File

@@ -203,9 +203,16 @@ void drawFromDrawCommands(gfx::DrawRoot const& rDrawRoot, SalGraphics& rGraphics
aPolyPolygon.transform(basegfx::utils::createTranslateB2DHomMatrix( aPolyPolygon.transform(basegfx::utils::createTranslateB2DHomMatrix(
-aPolyPolygonRange.getMinX(), -aPolyPolygonRange.getMinY())); -aPolyPolygonRange.getMinX(), -aPolyPolygonRange.getMinY()));
aPolyPolygon.transform(basegfx::utils::createScaleB2DHomMatrix(
aFinalRectangle.getWidth() / aPolyPolygonRange.getWidth(), double fScaleX = 1.0;
aFinalRectangle.getHeight() / aPolyPolygonRange.getHeight())); double fScaleY = 1.0;
if (aPolyPolygonRange.getWidth() > 0.0)
fScaleX = aFinalRectangle.getWidth() / aPolyPolygonRange.getWidth();
if (aPolyPolygonRange.getHeight() > 0.0)
fScaleY = aFinalRectangle.getHeight() / aPolyPolygonRange.getHeight();
aPolyPolygon.transform(basegfx::utils::createScaleB2DHomMatrix(fScaleX, fScaleY));
aPolyPolygon.transform(basegfx::utils::createTranslateB2DHomMatrix( aPolyPolygon.transform(basegfx::utils::createTranslateB2DHomMatrix(
aFinalRectangle.getMinX() - 0.5, aFinalRectangle.getMinY() - 0.5)); aFinalRectangle.getMinX() - 0.5, aFinalRectangle.getMinY() - 0.5));
@@ -698,6 +705,24 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion(
rNativeContentRegion = rBoundingControlRegion; rNativeContentRegion = rBoundingControlRegion;
return true; return true;
} }
break;
case ControlType::Scrollbar:
{
if (ePart == ControlPart::ButtonUp || ePart == ControlPart::ButtonDown
|| ePart == ControlPart::ButtonLeft || ePart == ControlPart::ButtonRight)
{
rNativeContentRegion = tools::Rectangle(aLocation, Size(0, 0));
rNativeBoundingRegion = rNativeContentRegion;
return true;
}
else
{
rNativeBoundingRegion = rBoundingControlRegion;
rNativeContentRegion = rNativeBoundingRegion;
return true;
}
}
break;
default: default:
break; break;

View File

@@ -227,14 +227,12 @@
<scrollbar> <scrollbar>
<part value="ThumbHorz"> <part value="ThumbHorz">
<state> <state>
<rect stroke="#C7C7C7" fill="#C7C7C7" stroke-width="1" /> <external source="scrollbar-horizontal.svgx" />
<line stroke="#007AFF" stroke-width="5" x1="0.01" y1="0.5" x2="0.99" y2="0.5"/>
</state> </state>
</part> </part>
<part value="ThumbVert"> <part value="ThumbVert">
<state> <state>
<rect stroke="#C7C7C7" fill="#C7C7C7" stroke-width="1" /> <external source="scrollbar-vertical.svgx" />
<line stroke="#007AFF" stroke-width="5" x1="0.5" y1="0.01" x2="0.5" y2="0.99"/>
</state> </state>
</part> </part>
<part value="ButtonUp"> <part value="ButtonUp">
@@ -247,22 +245,22 @@
</part> </part>
<part value="TrackHorzLeft"> <part value="TrackHorzLeft">
<state> <state>
<rect stroke="#C7C7C7" fill="#C7C7C7" stroke-width="1" /> <rect stroke="#8e8e93" fill="#ffffff" stroke-width="0" />
</state> </state>
</part> </part>
<part value="TrackHorzRight"> <part value="TrackHorzRight">
<state> <state>
<rect stroke="#C7C7C7" fill="#C7C7C7" stroke-width="1" /> <rect stroke="#8e8e93" fill="#ffffff" stroke-width="0" />
</state> </state>
</part> </part>
<part value="TrackVertUpper"> <part value="TrackVertUpper">
<state> <state>
<rect stroke="#C7C7C7" fill="#C7C7C7" stroke-width="1" /> <rect stroke="#8e8e93" fill="#ffffff" stroke-width="0" />
</state> </state>
</part> </part>
<part value="TrackVertLower"> <part value="TrackVertLower">
<state> <state>
<rect stroke="#C7C7C7" fill="#C7C7C7" stroke-width="1" /> <rect stroke="#8e8e93" fill="#ffffff" stroke-width="0" />
</state> </state>
</part> </part>
</scrollbar> </scrollbar>

View File

@@ -0,0 +1,4 @@
<svg version="1.1" viewBox="0 0 50 16" xmlns="http://www.w3.org/2000/svg">
<rect width="50" height="16" fill="#fff"/>
<path d="m43.943 8h-37.886" fill="none" stroke="#8e8e93" stroke-linecap="round" stroke-width="8"/>
</svg>

After

Width:  |  Height:  |  Size: 226 B

View File

@@ -0,0 +1,4 @@
<svg version="1.1" viewBox="0 0 16 50" xmlns="http://www.w3.org/2000/svg">
<rect y="1e-7" width="16" height="50" fill="#fff"/>
<path d="m8 43.943v-37.886" fill="none" stroke="#8e8e93" stroke-linecap="round" stroke-width="8"/>
</svg>

After

Width:  |  Height:  |  Size: 235 B