From 6b3d0933cedd573f01abb0e2da24201f15910c5f Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 2 Jan 2019 17:16:57 +0200 Subject: [PATCH] fix max length ruler for panels --- containment/package/contents/ui/Ruler.qml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/containment/package/contents/ui/Ruler.qml b/containment/package/contents/ui/Ruler.qml index 3267cf8eb..5cc892708 100644 --- a/containment/package/contents/ui/Ruler.qml +++ b/containment/package/contents/ui/Ruler.qml @@ -33,8 +33,8 @@ import "../code/ColorizerTools.js" as ColorizerTools Item{ id: rulerItem - width: root.isHorizontal ? root.maxLength : thickness - height: root.isVertical ? root.maxLength : thickness + width: root.isHorizontal ? userMaxLength : thickness + height: root.isVertical ? userMaxLength : thickness opacity: root.editMode ? 1 : 0 @@ -45,6 +45,14 @@ Item{ readonly property string tooltip: i18nc("maximum length tooltip, %0% is maximum length percentage","You can use mouse wheel to change maximum length of %0%").arg(plasmoid.configuration.maxLength) + readonly property int userMaxLength: { + if (root.isHorizontal) { + return root.width * (plasmoid.configuration.maxLength/100); + } else { + return root.height * (plasmoid.configuration.maxLength/100); + } + } + x: { if (root.isHorizontal) { return xL; @@ -70,7 +78,7 @@ Item{ } - property int length: root.maxLength + property int length: userMaxLength property int rMargin: 3 property int xL: 0