improve dragging dock settings window behavior

--improve how window length is calculated for normal
settings mode and the window in centered based on the
current view in that case. Lost story short, in that
case the length must be increased two times based on
position dragging movement because the window is
anchored centered.
work/spdx
Michail Vourlakos 4 years ago
parent df03f51fdc
commit 691fef2c76

@ -91,7 +91,11 @@ Rectangle {
differX = curGlobalX - initGlobalX;
}
var percentX = differX / initWidth;
//! In normal settings mode for horizontal View when dragging the corner the length must be increased two times
//! in order to be in the exact position when finished
var percentXMultiplier = (!dialog.advancedLevel && plasmoid.formFactor===PlasmaCore.Types.Horizontal ? 2 : 1);
var percentX = percentXMultiplier * (differX / initWidth);
var newScaleWidth = Math.max(0.35, initScaleWidth + (percentX*initScaleWidth)).toFixed(3);
var newScaleHeight = dialog.userScaleHeight;
@ -109,7 +113,8 @@ Rectangle {
differY = initGlobalY - curGlobalY;
}
var percentY = differY / initHeight;
var percentYMultiplier = (!dialog.advancedLevel && plasmoid.formFactor===PlasmaCore.Types.Vertical ? 2 : 1);
var percentY = percentYMultiplier * (differY / initHeight);
newScaleHeight = Math.max(0.5, initScaleHeight + (percentY*initScaleHeight)).toFixed(3);
}

Loading…
Cancel
Save