[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/uiconfig

2019-03-11 Thread Libreoffice Gerrit user
 vcl/source/gdi/FileDefinitionWidgetDraw.cxx   |   74 +++---
 vcl/uiconfig/theme_definitions/definition.xml |2 
 2 files changed, 35 insertions(+), 41 deletions(-)

New commits:
commit 212a40aaf7ec3316d5209b688f5f79821f99fbdc
Author: Tomaž Vajngerl 
AuthorDate: Mon Mar 11 17:08:18 2019 +0100
Commit: Tomaž Vajngerl 
CommitDate: Mon Mar 11 23:09:18 2019 +0100

widget theme: change the tab item height to (min) 32 px

Change-Id: I1919300071a06242fe832880b46c944989daa4b6
Reviewed-on: https://gerrit.libreoffice.org/69057
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx 
b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index 213547cc2d3a..64ef751c7476 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -776,10 +776,12 @@ bool FileDefinitionWidgetDraw::getNativeControlRegion(
 if (!pPart)
 return false;
 
-rNativeBoundingRegion = tools::Rectangle(
-rBoundingControlRegion.TopLeft(),
-Size(rBoundingControlRegion.GetWidth() + pPart->mnMarginWidth,
- rBoundingControlRegion.GetHeight() + 
pPart->mnMarginHeight));
+long nWidth = std::max(rBoundingControlRegion.GetWidth() + 
pPart->mnMarginWidth,
+   long(pPart->mnWidth));
+long nHeight = std::max(rBoundingControlRegion.GetHeight() + 
pPart->mnMarginHeight,
+long(pPart->mnHeight));
+
+rNativeBoundingRegion = tools::Rectangle(aLocation, Size(nWidth, 
nHeight));
 rNativeContentRegion = rNativeBoundingRegion;
 return true;
 }
diff --git a/vcl/uiconfig/theme_definitions/definition.xml 
b/vcl/uiconfig/theme_definitions/definition.xml
index e91953109554..5a4be114ea97 100644
--- a/vcl/uiconfig/theme_definitions/definition.xml
+++ b/vcl/uiconfig/theme_definitions/definition.xml
@@ -320,7 +320,7 @@
 
 
 
-
+
 
 
 
commit 897f6f6252f38e93764aa0e72135768ab1ec3679
Author: Tomaž Vajngerl 
AuthorDate: Mon Mar 11 16:52:37 2019 +0100
Commit: Tomaž Vajngerl 
CommitDate: Mon Mar 11 23:09:08 2019 +0100

better adjustment algorithm for dynamic sized widgets

A algorithm that gives better results for dynamically sized
widgets is to increase proportionally only the points in shapes
that are over the half of the widget width (or height, when
adjusting the other dimension). This preserves the margins and
doesn't distort the shape of the paths, which is especially
visible when the source needs to be largely resized in one
dimension only.

Change-Id: I2cceb249063387c0f7400ef8d75adb5899aa8c23
Reviewed-on: https://gerrit.libreoffice.org/69056
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx 
b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index 3c0ad43c99b7..213547cc2d3a 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -165,24 +165,18 @@ void drawFromDrawCommands(gfx::DrawRoot const& rDrawRoot, 
SalGraphics& rGraphics
 
 basegfx::B2DRange aInputRectangle(rRectangle.maRectangle);
 
+double fDeltaX = aTargetSurface.getWidth() - 
aSVGRect.getWidth();
+double fDeltaY = aTargetSurface.getHeight() - 
aSVGRect.getHeight();
+
 basegfx::B2DRange aFinalRectangle(
-aTargetSurface.getMinX() + aInputRectangle.getMinX(),
-aTargetSurface.getMinY() + aInputRectangle.getMinY(),
-aTargetSurface.getMaxX() - (aSVGRect.getMaxX() - 
aInputRectangle.getMaxX()),
-aTargetSurface.getMaxY() - (aSVGRect.getMaxY() - 
aInputRectangle.getMaxY()));
-
-
aInputRectangle.transform(basegfx::utils::createTranslateB2DHomMatrix(
--aInputRectangle.getMinX(), -aInputRectangle.getMinY()));
-
aInputRectangle.transform(basegfx::utils::createScaleB2DHomMatrix(
-aFinalRectangle.getWidth() / aInputRectangle.getWidth(),
-aFinalRectangle.getHeight() / 
aInputRectangle.getHeight()));
-
aInputRectangle.transform(basegfx::utils::createTranslateB2DHomMatrix(
-aFinalRectangle.getMinX() - 0.5,
-aFinalRectangle.getMinY()
-- 0.5)); // compensate 0.5 for different 
interpretation of where the center of a pixel is
+aInputRectangle.getMinX(), aInputRectangle.getMinY(),
+aInputRectangle.getMaxX() + fDeltaX, 
aInputRectangle.getMaxY() + fDeltaY);
+
+
aFinalRectangle.transform(basegfx::utils::createTranslateB2DHomMatrix(
+aTargetSurface.getMinX() 

[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/uiconfig

2019-03-10 Thread Libreoffice Gerrit user
 vcl/source/gdi/FileDefinitionWidgetDraw.cxx   |   10 --
 vcl/uiconfig/theme_definitions/definition.xml |   11 +++
 2 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit e089b75ba2758183e6eb389d4070560c8989c4e4
Author: Tomaž Vajngerl 
AuthorDate: Sun Mar 10 21:30:28 2019 +0100
Commit: Tomaž Vajngerl 
CommitDate: Mon Mar 11 00:14:35 2019 +0100

widget theme: change color for window background and frame

Change-Id: I37f1524db71eea2912ffb65fdd7a00605e6b1d4d
Reviewed-on: https://gerrit.libreoffice.org/69017
Reviewed-by: Tomaž Vajngerl 
Tested-by: Tomaž Vajngerl 

diff --git a/vcl/uiconfig/theme_definitions/definition.xml 
b/vcl/uiconfig/theme_definitions/definition.xml
index 23a19de392d5..46346286756c 100644
--- a/vcl/uiconfig/theme_definitions/definition.xml
+++ b/vcl/uiconfig/theme_definitions/definition.xml
@@ -366,25 +366,20 @@
 
 
 
-
+
 
 
 
 
-
+
 
 
 
 
 
-
-
-
-
-
 
 
-
+
 
 
 
commit cbfe46bf79ac89f7cd1916eeaaf5f10164038535
Author: Tomaž Vajngerl 
AuthorDate: Sun Mar 10 21:29:25 2019 +0100
Commit: Tomaž Vajngerl 
CommitDate: Mon Mar 11 00:14:22 2019 +0100

widget theme: take into account scaling factor for images

Change-Id: I65bd71dfd113fae33aee7c2b60b945e065314f80
Reviewed-on: https://gerrit.libreoffice.org/69016
Reviewed-by: Tomaž Vajngerl 
Tested-by: Tomaž Vajngerl 

diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx 
b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index b51d98b2c073..5c0920bca4d6 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -27,6 +27,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -336,13 +337,18 @@ void 
munchDrawCommands(std::vector> const& rDrawCom
 break;
 case DrawCommandType::IMAGE:
 {
+double nScaleFactor = 1.0;
+if (comphelper::LibreOfficeKit::isActive())
+nScaleFactor = comphelper::LibreOfficeKit::getDPIScale();
+
 auto const& rDrawCommand = static_cast(*pDrawCommand);
 SvFileStream aFileStream(rDrawCommand.msSource, 
StreamMode::READ);
 BitmapEx aBitmap;
-vcl::bitmap::loadFromSvg(aFileStream, "", aBitmap, 1.0);
+vcl::bitmap::loadFromSvg(aFileStream, "", aBitmap, 
nScaleFactor);
 long nImageWidth = aBitmap.GetSizePixel().Width();
 long nImageHeight = aBitmap.GetSizePixel().Height();
-SalTwoRect aTR(0, 0, nImageWidth, nImageHeight, nX, nY, 
nImageWidth, nImageHeight);
+SalTwoRect aTR(0, 0, nImageWidth, nImageHeight, nX, nY, 
nImageWidth / nScaleFactor,
+   nImageHeight / nScaleFactor);
 if (!!aBitmap)
 {
 const std::shared_ptr pSalBitmap
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/uiconfig

2019-03-04 Thread Libreoffice Gerrit user
 vcl/source/gdi/FileDefinitionWidgetDraw.cxx   |   58 ++
 vcl/source/gdi/WidgetDefinitionReader.cxx |   11 
 vcl/uiconfig/theme_definitions/definition.xml |   33 ++
 3 files changed, 94 insertions(+), 8 deletions(-)

New commits:
commit 394bf64515273985b30f77033c95277b41f021c4
Author: Tomaž Vajngerl 
AuthorDate: Tue Jan 29 13:53:48 2019 +0100
Commit: Tomaž Vajngerl 
CommitDate: Mon Mar 4 22:42:00 2019 +0100

Draw basic combobox from the theme definition

Change-Id: I2ed631676be878bd5e89872077ab47937aabbf7a
Reviewed-on: https://gerrit.libreoffice.org/68697
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx 
b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index a287f2c0fee7..6681d2190dd2 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -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 pPart
+= m_aWidgetDefinition.getDefinition(eType, ePart);
+if (pPart)
+{
+auto aStates = pPart->getStates(eState, rValue);
+if (!aStates.empty())
+{
+std::shared_ptr 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;
 }
diff --git a/vcl/source/gdi/WidgetDefinitionReader.cxx 
b/vcl/source/gdi/WidgetDefinitionReader.cxx
index 40dcbcee45bb..f37385cc09b9 100644
--- a/vcl/source/gdi/WidgetDefinitionReader.cxx
+++ b/vcl/source/gdi/WidgetDefinitionReader.cxx
@@ -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;
 }
diff --git a/vcl/uiconfig/theme_definitions/definition.xml 
b/vcl/uiconfig/theme_definitions/definition.xml
index fa37bf8f5ba2..0cbdebaa078c 100644
--- a/vcl/uiconfig/theme_definitions/definition.xml
+++ b/vcl/uiconfig/theme_definitions/definition.xml
@@ -90,6 +90,26 @@
 
 
 
+
+
+
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 
commit c4378dd23edd70110cada99b97a8df6d6f6d47d2
Author: Tomaž Vajngerl 
AuthorDate: Tue Jan 29 13:51:50 2019 +0100
Commit: Tomaž Vajngerl 
CommitDate: Mon Mar 4 22:41:51 2019 +0100

Draw basic checkbox from the theme definition

Change-Id: I8b8a0bbe0d17736dd19151cebe4ad2d5344ea691
Reviewed-on: https://gerrit.libreoffice.org/68693
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx 
b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index bc46bcbdd67f..a287f2c0fee7 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -49,8 +49,8 @@ bool 
FileDefinitionWidgetDraw::isNativeControlSupported(ControlType eType, Contr
 case ControlType::Generic:
 case ControlType::Pushbutton:
 

[Libreoffice-commits] core.git: 2 commits - vcl/source vcl/uiconfig

2019-03-04 Thread Libreoffice Gerrit user
 vcl/source/gdi/FileDefinitionWidgetDraw.cxx   |9 -
 vcl/uiconfig/theme_definitions/definition.xml |3 ++-
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit e881cb41363874f1644728f2d35dc057e7e484ec
Author: Tomaž Vajngerl 
AuthorDate: Fri Jan 25 17:01:12 2019 +0100
Commit: Tomaž Vajngerl 
CommitDate: Mon Mar 4 12:32:10 2019 +0100

draw polyline and polygon when drawing rect draw command

Change-Id: Ic00d090e0aa85d451a50be52794606546021be38
Reviewed-on: https://gerrit.libreoffice.org/68671
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx 
b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
index 600b736c3c7c..854066694e22 100644
--- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
+++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx
@@ -107,10 +107,17 @@ void 
munchDrawCommands(std::vector> const& rDrawCom
 rRectDrawCommand.mnRx, 
rRectDrawCommand.mnRy);
 
 basegfx::B2DPolygon aB2DPolygon(aPolygon.getB2DPolygon());
-rGraphics.SetLineColor(rRectDrawCommand.maStrokeColor);
+rGraphics.SetLineColor();
 rGraphics.SetFillColor(rRectDrawCommand.maFillColor);
 rGraphics.DrawPolyPolygon(basegfx::B2DHomMatrix(),
   
basegfx::B2DPolyPolygon(aB2DPolygon), 0.0f, nullptr);
+rGraphics.SetLineColor(rRectDrawCommand.maStrokeColor);
+rGraphics.SetFillColor();
+rGraphics.DrawPolyLine(basegfx::B2DHomMatrix(), aB2DPolygon, 
0.0f,
+   
basegfx::B2DVector(rRectDrawCommand.mnStrokeWidth,
+  
rRectDrawCommand.mnStrokeWidth),
+   basegfx::B2DLineJoin::Round, 
css::drawing::LineCap_ROUND,
+   0.0f, false, nullptr);
 }
 break;
 case DrawCommandType::CIRCLE:
commit 9d86d3538b588d1e4864b9d26c301cd8d6932858
Author: Tomaž Vajngerl 
AuthorDate: Fri Jan 25 17:00:06 2019 +0100
Commit: Tomaž Vajngerl 
CommitDate: Mon Mar 4 12:31:55 2019 +0100

use line for editbox theme definition

Change-Id: Ie70d1050a58d96443fe5df9c743ba201fca9d25f
Reviewed-on: https://gerrit.libreoffice.org/68670
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/uiconfig/theme_definitions/definition.xml 
b/vcl/uiconfig/theme_definitions/definition.xml
index 2bd0212007ee..91c473f290a6 100644
--- a/vcl/uiconfig/theme_definitions/definition.xml
+++ b/vcl/uiconfig/theme_definitions/definition.xml
@@ -81,7 +81,8 @@
 
 
 
-
+
+
 
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits