fix max length ruler for panels

pull/4/head
Michail Vourlakos 6 years ago
parent 48f7d468fb
commit 6b3d0933ce

@ -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

Loading…
Cancel
Save