From a44138dd5c4b1c0f28f127140de0836d4999f144 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Fri, 14 Sep 2018 17:41:30 -0400 Subject: 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 --- src/core/Bootstrap.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/core/Bootstrap.cpp') 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()) { -- cgit v1.2.3