diff options
author | Jonathan White <support@dmapps.us> | 2018-09-15 00:41:30 +0300 |
---|---|---|
committer | Janek Bevendorff <janek@jbev.net> | 2018-10-20 16:30:48 +0300 |
commit | a44138dd5c4b1c0f28f127140de0836d4999f144 (patch) | |
tree | 96b252f9224f00c3ee573abe8c2aadb6ae064cf7 /src/core/Bootstrap.cpp | |
parent | c749f7018e541b89d03823dfeafe850ab049ac21 (diff) |
Multiple fixes to MainWindow and some cleanup
* Fix MainWindow startup when minimize to tray was enabled
* Reduce duplicate code in DatabaseWidget.cpp
* Fix snapcraft build dependencies
* Add support for CTRL+TAB, CTRL+PGUP, CTRL+SHIFT+TAB, CTRL+PGDN to control database tabs from any focus location
* Add CTRL+SHIFT+M shortcut to minimize to tray
* Allow minimize instead of app exit without tray icon
Diffstat (limited to 'src/core/Bootstrap.cpp')
-rw-r--r-- | src/core/Bootstrap.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/core/Bootstrap.cpp b/src/core/Bootstrap.cpp index 2c25b2505..70ca7eec4 100644 --- a/src/core/Bootstrap.cpp +++ b/src/core/Bootstrap.cpp @@ -71,20 +71,10 @@ void bootstrapApplication() void restoreMainWindowState(MainWindow& mainWindow) { // start minimized if configured - bool minimizeOnStartup = config()->get("GUI/MinimizeOnStartup").toBool(); - bool minimizeToTray = config()->get("GUI/MinimizeToTray").toBool(); -#ifndef Q_OS_LINUX - if (minimizeOnStartup) { -#else - // On some Linux systems, the window should NOT be minimized and hidden (i.e. not shown), at - // the same time (which would happen if both minimize on startup and minimize to tray are set) - // since otherwise it causes problems on restore as seen on issue #1595. Hiding it is enough. - if (minimizeOnStartup && !minimizeToTray) { -#endif - mainWindow.setWindowState(Qt::WindowMinimized); - } - if (!(minimizeOnStartup && minimizeToTray)) { - mainWindow.show(); + if (config()->get("GUI/MinimizeOnStartup").toBool()) { + mainWindow.showMinimized(); + } else { + mainWindow.bringToFront(); } if (config()->get("OpenPreviousDatabasesOnStartup").toBool()) { |