add re-maximize setting

This commit is contained in:
Peter Fajdiga
2023-09-19 21:13:10 +02:00
parent 734dd8a4cc
commit 09e5eaca88
6 changed files with 23 additions and 5 deletions

View File

@@ -229,8 +229,18 @@
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QCheckBox" name="kcfg_reMaximize">
<property name="text">
<string>Re-maximize tiled windows</string>
</property>
<property name="toolTip">
<string>Restore maximized and full-screen states of tiled windows on focus</string>
</property>
</widget>
</item>
<item row="13" column="1">
<spacer name="separator_layering">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -246,21 +256,21 @@
</property>
</spacer>
</item>
<item row="13" column="0">
<item row="14" column="0">
<widget class="QLabel" name="label_layering">
<property name="text">
<string>Layering mode:</string>
</property>
</widget>
</item>
<item row="13" column="1">
<item row="14" column="1">
<widget class="QRadioButton" name="kcfg_tiledKeepBelow">
<property name="text">
<string>Keep tiled windows below</string>
</property>
</widget>
</item>
<item row="14" column="1">
<item row="15" column="1">
<widget class="QRadioButton" name="kcfg_floatingKeepAbove">
<property name="text">
<string>Keep floating windows above</string>

View File

@@ -10,6 +10,7 @@ type Config = {
untileOnDrag: boolean,
stackColumnsByDefault: boolean,
resizeNeighborColumn: boolean,
reMaximize: boolean,
tiledKeepBelow: boolean,
floatingKeepAbove: boolean,
windowRules: string,

View File

@@ -107,6 +107,11 @@ const configDef = [
"type": "Bool",
"default": false
},
{
"name": "reMaximize",
"type": "Bool",
"default": false
},
{
"name": "tiledKeepBelow",
"type": "Bool",

View File

@@ -3,6 +3,7 @@ type LayoutConfig = {
gapsInnerVertical: number,
stackColumnsByDefault: boolean,
resizeNeighborColumn: boolean,
reMaximize: boolean,
tiledKeepBelow: boolean,
maximizedKeepAbove: boolean,
};

View File

@@ -34,7 +34,7 @@ class Window {
}
let maximized = false;
if (this.isFocused()) {
if (this.column.grid.config.reMaximize && this.isFocused()) {
// do this here rather than in `onFocused` to ensure it happens after placement
// (otherwise placement may not happen at all)
if (this.focusedState.maximizedVertically || this.focusedState.maximizedHorizontally) {

View File

@@ -35,6 +35,7 @@ class World {
gapsInnerVertical: config.gapsInnerVertical,
stackColumnsByDefault: config.stackColumnsByDefault,
resizeNeighborColumn: config.resizeNeighborColumn,
reMaximize: config.reMaximize,
tiledKeepBelow: config.tiledKeepBelow,
maximizedKeepAbove: config.floatingKeepAbove,
},