Commit 9c0772c4 authored by ivan tkachenko's avatar ivan tkachenko Committed by Nate Graham
Browse files

[desktoppackage] Fix ruler handles' defaultPosition (reset behavior)

Panel length turned out to be not what it claimed to be, which caused a
bug to sneak into the panel configuration's ruler handles: they tried
to reset to this preferred length instead of current/actual length, and
without additional checks that could've ended up wider/taller than the
screen, rendering one or both pairs of resize handles unreachable and
unusable until a panel is brought to some other edge of a screen.

Amends 085087f8.
parent 05829c83
Pipeline #208926 passed with stage
in 6 minutes and 28 seconds
......@@ -44,8 +44,15 @@ PlasmaCore.SvgItem {
property int maximumPosition
//Provide default position for "reset" action.
function defaultPosition(): int {
var dialogSize = dialogRoot.vertical ? dialogRoot.height : dialogRoot.width;
return (value === panel.length) ? dialogSize : panel.length;
var dialogSize, panelSize;
if (dialogRoot.vertical) {
dialogSize = dialogRoot.height;
panelSize = panel.height;
} else {
dialogSize = dialogRoot.width;
panelSize = panel.width;
}
return (value === panelSize) ? dialogSize : panelSize;
}
// Handle name displayed as a tooltip.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment