1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-05 17:17:49 +03:00

canvas ruler:decrease view maxlength properly

--whem view minlength and maxlength are equals
the Canvas Ruler should decrease and increase
both of them when the user mouse scrolls the ruler
This commit is contained in:
Michail Vourlakos 2021-12-11 19:54:29 +02:00
parent a553f7403f
commit 3287a293b9

View File

@ -34,10 +34,17 @@ MouseArea{
//! replica of updating maximum length from configuration tab
function updateMaxLength(step) {
var updateminimumlength = (plasmoid.configuration.maxLength === plasmoid.configuration.minLength);
var tempML = plasmoid.configuration.maxLength + step;
var value = Math.max(Math.min(tempML,100),30);
var value = Math.max(Math.min(tempML,100), 30);
if (updateminimumlength) {
plasmoid.configuration.minLength = Math.max(30, value);
}
value = Math.max(plasmoid.configuration.minLength, value);
plasmoid.configuration.maxLength = value;
var newTotal = Math.abs(plasmoid.configuration.offset) + value;