Allow maximising panel conditionally.

Add code that maximises panel length when maximised windows are present on the same screen.
pull/29/head
Lana Black 1 year ago
parent 7b210a9970
commit 66e52716b4

@ -190,6 +190,10 @@
<entry name="offset" type="Double">
<default>0</default>
</entry>
<entry name="maximizeWhenMaximized" type="Bool">
<default>false</default>
<label>Maximize panel in presense of maximized windows</label>
</entry>
<entry name="dragActiveWindowEnabled" type="Bool">
<default>false</default>
<label>Drag and maximize/restore active window from empty areas</label>

@ -203,6 +203,7 @@ Item {
readonly property int minAppletLengthInConfigure: 16
readonly property int maxJustifySplitterSize: 64
property bool maximizeWhenMaximized: plasmoid.configuration.maximizeWhenMaximized;
property real minLengthPerCentage: plasmoid.configuration.minLength
property real maxLengthPerCentage: hideLengthScreenGaps ? 100 : plasmoid.configuration.maxLength
@ -219,10 +220,12 @@ Item {
}
property int maxLength: {
const maximize = behaveAsPlasmaPanel
|| (maximizeWhenMaximized && latteView.windowsTracker.currentScreen.existsWindowMaximized);
if (root.isHorizontal) {
return behaveAsPlasmaPanel ? width : width * (maxLengthPerCentage/100)
return maximize ? width : width * (maxLengthPerCentage/100)
} else {
return behaveAsPlasmaPanel ? height : height * (maxLengthPerCentage/100)
return maximize ? height : height * (maxLengthPerCentage/100)
}
}

@ -563,6 +563,28 @@ PlasmaComponents.Page {
}
}
}
LatteComponents.SubHeader {
visible: dialog.advancedLevel
text: i18nc("@label dynamic length configuration", "Dynamic Length Adjustments")
enabled: true
}
LatteComponents.CheckBoxesColumn {
enabled: dialog.advancedLevel;
LatteComponents.CheckBox {
id: maximizeWhenMaximizedChk
Layout.maximumWidth: dialog.optionsWidth
text: i18nc("@label", "Maximize panel length in presence of maximized windows")
tooltip: i18n("Change panel length to maximum screen size when there is a maximized window present on the screen")
enabled: showBackground.checked
visible: dialog.advancedLevel
value: plasmoid.configuration.maximizeWhenMaximized
onClicked: {
plasmoid.configuration.maximizeWhenMaximized = !plasmoid.configuration.maximizeWhenMaximized;
}
}
}
}
//! END: Length

Loading…
Cancel
Save