1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-27 14:50:21 +03:00

fix max length ruler for panels

This commit is contained in:
Michail Vourlakos 2019-01-02 17:16:57 +02:00
parent f92d707793
commit 6ccf025a09

View File

@ -31,8 +31,8 @@ import org.kde.latte 0.1 as Latte
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
@ -43,6 +43,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;
@ -68,7 +76,7 @@ Item{
}
property int length: root.maxLength
property int length: userMaxLength
property int rMargin: 3
property int xL: 0