floating,support two different struts thickness

- Hide Thickness Screen Gap scenario provides two different struts thicknesses.
--- [1] The first struts thickness is when there is no maximized window and is such case
---     the view is behaving as in normal AlwaysVisible visibility mode. This is very useful
---     when users tile windows. [bug #432122]
--- [2] The second struts thickness is when there is a maximized window present and in such case
---     the view is hiding all of its screen edges. It is used mostly when the view is wanted
---     to act as a window titlebar.

BUG:432122
work/spdx
Michail Vourlakos 4 years ago
parent d21fc43b8c
commit 66361652ef

@ -67,9 +67,9 @@
<default>false</default>
<label>floating gap is disabled when there are maximized windows</label>
</entry>
<entry name="floatingGapIsMirroredForMaximized" type="Bool">
<entry name="floatingGapIsMirrored" type="Bool">
<default>false</default>
<label>floating gap is mirrored for maximized windows in AlwaysVisible visibility mode</label>
<label>floating gap is mirrored when it is shown in AlwaysVisible visibility mode</label>
</entry>
<entry name="proportionIconSize" type="Double">
<default>-1</default>

@ -301,11 +301,20 @@ Item{
var isCapableToHideScreenGap = root.screenEdgeMarginEnabled && plasmoid.configuration.hideFloatingGapForMaximized
var mirrorGapFactor = root.mirrorScreenGap ? 2 : 1;
//! Hide Thickness Screen Gap scenario provides two different struts thicknesses.
//! [1] The first struts thickness is when there is no maximized window and is such case
//! the view is behaving as in normal AlwaysVisible visibility mode. This is very useful
//! when users tile windows. [bug #432122]
//! [2] The second struts thickness is when there is a maximized window present and in such case
//! the view is hiding all of its screen edges. It is used mostly when the view is wanted
//! to act as a window titlebar.
var thicknessForIsCapableToHideScreenGap = (root.hideThickScreenGap ? 0 : mirrorGapFactor * metrics.mask.screenEdge);
if (root.behaveAsPlasmaPanel) {
return isCapableToHideScreenGap ? thicknessAsPanel : (mirrorGapFactor*metrics.mask.screenEdge) + thicknessAsPanel;
return isCapableToHideScreenGap ? (thicknessAsPanel + thicknessForIsCapableToHideScreenGap) : (mirrorGapFactor*metrics.mask.screenEdge) + thicknessAsPanel;
}
var edgeThickness = isCapableToHideScreenGap ? 0 : metrics.mask.screenEdge * mirrorGapFactor;
var edgeThickness = isCapableToHideScreenGap ? thicknessForIsCapableToHideScreenGap : metrics.mask.screenEdge * mirrorGapFactor;
return edgeThickness + metrics.mask.thickness.maxNormalForItemsWithoutScreenEdge;
}
}

@ -179,8 +179,7 @@ Item {
property bool hideLengthScreenGaps: false /*set through binding*/
property bool mirrorScreenGap: screenEdgeMarginEnabled
&& plasmoid.configuration.floatingGapIsMirroredForMaximized
&& !plasmoid.configuration.hideFloatingGapForMaximized
&& plasmoid.configuration.floatingGapIsMirrored
&& latteView.visibility.mode === LatteCore.Types.AlwaysVisible

@ -885,13 +885,13 @@ PlasmaComponents.Page {
LatteComponents.CheckBox {
Layout.maximumWidth: dialog.optionsWidth
enabled: !plasmoid.configuration.hideFloatingGapForMaximized
text: i18n("Mirror floating gap for maximized windows")
checked: plasmoid.configuration.floatingGapIsMirroredForMaximized
tooltip: i18n("Floating gap is mirrored when there are maximized windows in Always Visible mode")
enabled: latteView.visibility.mode === LatteCore.Types.AlwaysVisible
text: i18n("Mirror floating gap when it is shown")
checked: plasmoid.configuration.floatingGapIsMirrored
tooltip: i18n("Floating gap is mirrored when it is shown in Always Visible mode")
onClicked: {
plasmoid.configuration.floatingGapIsMirroredForMaximized = checked;
plasmoid.configuration.floatingGapIsMirrored = checked;
}
}
}

Loading…
Cancel
Save