Commit 4655fb0a authored by Eike Hein's avatar Eike Hein
Browse files

Add an option for keeping the window open after the last session closes.

BUG:308850
parent a7bf349a
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>364</width>
<height>308</height>
<width>356</width>
<height>289</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
......@@ -20,31 +20,49 @@
<string comment="@title:group Group box label">General</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_OpenAfterStart">
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_FocusFollowsMouse">
<property name="text">
<string comment="@option:check">Open window after program start</string>
<string comment="@option:check">Focus terminals when the mouse pointer is moved over them</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_PollMouse">
<item row="4" column="1">
<widget class="QCheckBox" name="kcfg_ToggleToFocus">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string comment="@info:whatsthis">If this option is enabled, the window will automatically open when the mouse pointer is moved to the same edge of the screen that it would open on when using the shortcut.</string>
<string comment="@info:whatsthis">If this option is enabled, the shortcut normally used to open and retract the window will give it focus, rather than close it, if it has previously lost focus. Unless the window is set to show on all virtual desktops, this may cause the window manager to switch to the virtual desktop it currently resides on.</string>
</property>
<property name="text">
<string comment="@option:check">Open window when the mouse pointer touches the screen edge</string>
<string comment="@option:check">Use Open/Retract action to focus window</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_KeepOpen">
<item row="3" column="1">
<widget class="QCheckBox" name="kcfg_KeepAbove">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string comment="@option:check">Keep window open when it loses focus</string>
<string comment="@option:check">Keep window above other windows</string>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
......@@ -60,23 +78,31 @@
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="kcfg_KeepAbove">
<property name="enabled">
<bool>false</bool>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_OpenAfterStart">
<property name="text">
<string comment="@option:check">Open window after program start</string>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_PollMouse">
<property name="whatsThis">
<string comment="@info:whatsthis">If this option is enabled, the window will automatically open when the mouse pointer is moved to the same edge of the screen that it would open on when using the shortcut.</string>
</property>
<property name="text">
<string comment="@option:check">Keep window above other windows</string>
<string comment="@option:check">Open window when the mouse pointer touches the screen edge</string>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_KeepOpen">
<property name="text">
<string comment="@option:check">Keep window open when it loses focus</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
......@@ -92,29 +118,10 @@
</property>
</spacer>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="kcfg_ToggleToFocus">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string comment="@info:whatsthis">If this option is enabled, the shortcut normally used to open and retract the window will give it focus, rather than close it, if it has previously lost focus. Unless the window is set to show on all virtual desktops, this may cause the window manager to switch to the virtual desktop it currently resides on.</string>
</property>
<property name="text">
<string comment="@option:check">Use Open/Retract action to focus window</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_FocusFollowsMouse">
<widget class="QCheckBox" name="kcfg_KeepOpenAfterLastSessionCloses">
<property name="text">
<string comment="@option:check">Focus terminals when the mouse pointer is moved over them</string>
<string extracomment="@option:check">Keep window open after the last session is closed</string>
</property>
</widget>
</item>
......@@ -152,6 +159,16 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>kcfg_OpenAfterStart</tabstop>
<tabstop>kcfg_PollMouse</tabstop>
<tabstop>kcfg_KeepOpen</tabstop>
<tabstop>kcfg_KeepAbove</tabstop>
<tabstop>kcfg_ToggleToFocus</tabstop>
<tabstop>kcg_KeepOpenAfterLastSessionCloses</tabstop>
<tabstop>kcfg_FocusFollowsMouse</tabstop>
<tabstop>kcfg_ConfirmQuit</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
......
......@@ -41,6 +41,11 @@
<whatsthis context="@info:whatsthis">Whether to keep the application window open when it loses focus.</whatsthis>
<default>true</default>
</entry>
<entry name="KeepOpenAfterLastSessionCloses" type="Bool">
<label context="@label">Keep window open after last session closes</label>
<whatsthis context="@info:whatsthis">Whether to keep the application window open after the last session is closed.</whatsthis>
<default>false</default>
</entry>
<entry name="ToggleToFocus" type="Bool">
<label context="@label">Use open/retract shortcut to focus window</label>
<whatsthis context="@info:whatsthis">Whether the open/retract keyboard shortcut can be used to focus the application window when it is already open.</whatsthis>
......
......@@ -538,7 +538,7 @@ void MainWindow::handleTerminalSilence(Terminal* terminal)
void MainWindow::handleLastTabClosed()
{
if (isVisible())
if (isVisible() && !Settings::keepOpenAfterLastSessionCloses())
toggleWindowState();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment