Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BTree: insert new window where active window is #13

Merged
merged 3 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Options -
* Blacklist (line input) - Windows to not tile, or if whitelist is selected, the only windows to tile
* Tile popup windows (check box) - Whether to tile windows marked as popup windows
* Tile borders (dropdown) - How to display borders on tiled, untiled, and selected windows
* Invert insertion (check box) - Inverts how windows are inserted on certain engines (BTree)
* Keep tiled below (check box) - Whether to keep tiled windows below other windows
* Default engine (dropdown) - The default tiling engine you want to use on new desktops
* BTree Insertion Point (dropdown) - Select where new windows should be inserted into the binary tree representation
* Debug mode (check box) - Whether to spam your user journal with debug messages or not

## Engines
Expand Down
Binary file modified polonium.kwinscript
Binary file not shown.
253 changes: 136 additions & 117 deletions res/config.ui
Original file line number Diff line number Diff line change
Expand Up @@ -14,60 +14,76 @@
<string>Polonium</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_TilePopups">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Tile popup/placeholder windows or not&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item row="7" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_KeepTiledBelow">
<property name="text">
<string>Tile popup windows</string>
<string>Keep tiled windows below</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="11" column="0" colspan="2">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_6">
<property name="font">
<font>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Debug options</string>
<string>Tiling options</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_UseWhitelist">
<property name="toolTip">
<string>If disabled, acts as a blacklist</string>
</property>
<property name="text">
<string>Use whitelist instead of blacklist</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_TilePopups">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Tile popup/placeholder windows or not&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Tile popup windows</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Layout engine</string>
</property>
</widget>
</item>
<item row="15" column="0" colspan="2">
<spacer name="verticalSpacer">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<width>0</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_InvertInsertion">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Inverts insertion order&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Invert insertion order</string>
</property>
</widget>
</item>
<item row="12" column="0" colspan="2">
<item row="13" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_Debug">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Spams your user journal&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
Expand All @@ -78,19 +94,16 @@
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Layout engine</string>
<string>BTree Insertion Point</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="kcfg_Blacklist">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Blacklist, do not tile these windows (becomes whitelist if whitelist is checked)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item row="5" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>krunner, yakuake, kded, polkit</string>
<string>Border visibility</string>
</property>
</widget>
</item>
Expand All @@ -101,7 +114,7 @@
</property>
</widget>
</item>
<item row="9" column="1">
<item row="8" column="1">
<widget class="QComboBox" name="kcfg_DefaultEngine">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select which default layout engine to use&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
Expand Down Expand Up @@ -136,8 +149,51 @@
</item>
</widget>
</item>
<item row="17" column="0" colspan="2">
<spacer name="verticalSpacer_4">
<item row="5" column="1">
<widget class="QComboBox" name="kcfg_Borders">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Changes where borders are or aren't&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>No border all</string>
</property>
</item>
<item>
<property name="text">
<string>No border tiled</string>
</property>
</item>
<item>
<property name="text">
<string>Border selected</string>
</property>
</item>
<item>
<property name="text">
<string>Border all</string>
</property>
</item>
</widget>
</item>
<item row="16" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="11" column="0" colspan="2">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
Expand All @@ -152,29 +208,6 @@
</property>
</spacer>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_UseWhitelist">
<property name="toolTip">
<string>If disabled, acts as a blacklist</string>
</property>
<property name="text">
<string>Use whitelist instead of blacklist</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="16" column="0" colspan="2">
<widget class="QLabel" name="label">
<property name="text">
<string>Changes apply only after restarting KWin!</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<spacer name="verticalSpacer_2">
<property name="orientation">
Expand All @@ -191,8 +224,18 @@
</property>
</spacer>
</item>
<item row="10" column="0" colspan="2">
<spacer name="verticalSpacer_3">
<item row="4" column="1">
<widget class="QLineEdit" name="kcfg_Blacklist">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Blacklist, do not tile these windows (becomes whitelist if whitelist is checked)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>krunner, yakuake, kded, polkit</string>
</property>
</widget>
</item>
<item row="18" column="0" colspan="2">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
Expand All @@ -207,83 +250,59 @@
</property>
</spacer>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_6">
<item row="17" column="0" colspan="2">
<widget class="QLabel" name="label">
<property name="text">
<string>Changes apply only after disabling and re-enabling the script!</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="12" column="0" colspan="2">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Tiling options</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_KeepTiledBelow">
<property name="text">
<string>Keep tiled windows below</string>
</property>
<property name="checked">
<bool>true</bool>
<string>Debug options</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="kcfg_Borders">
<item row="9" column="1">
<widget class="QComboBox" name="kcfg_BTreeInsertionPoint">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Changes where borders are or aren't&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="currentIndex">
<number>1</number>
<string>Select where in the binary tree representation of the window layout new windows are placed.
&quot;Left&quot; and &quot;Right&quot; will keep the binary tree complete, filling the last layer from the selected direction.
&quot;Active Window&quot; will split the tile of the currently active window in half and place the new window in the new, empty tile.</string>
</property>
<item>
<property name="text">
<string>No border all</string>
<string>Left side</string>
</property>
</item>
<item>
<property name="text">
<string>No border tiled</string>
<string>Right side</string>
</property>
</item>
<item>
<property name="text">
<string>Border selected</string>
<string>Active Window</string>
</property>
</item>
<item>
<property name="text">
<string>Border all</string>
</property>
</item>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Border visibility</string>
</property>
</widget>
</item>
<item row="14" column="0" colspan="2">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
Expand Down
2 changes: 1 addition & 1 deletion res/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<entry name="UseWhitelist" type="bool"><default>false</default></entry>
<entry name="Blacklist" type="string"><default>krunner, yakuake, kded, polkit</default></entry>
<entry name="TilePopups" type="bool"><default>false</default></entry>
<entry name="InvertInsertion" type="bool"><default>false</default></entry>
<entry name="BTreeInsertionPoint" type="int"><default>0</default></entry>
<entry name="KeepTiledBelow" type="bool"><default>true</default></entry>
<entry name="Debug" type="bool"><default>false</default></entry>
<entry name="Borders" type="int"><default>1</default></entry>
Expand Down
Loading