From 8a4a804c8ca3b1b7db89724127d694b56f5d7e7c Mon Sep 17 00:00:00 2001 From: Stefan Sundin Date: Tue, 15 Sep 2020 06:43:35 -0700 Subject: [PATCH] Use Alt+Tab on macOS to switch between databases (#5407) --- src/gui/MainWindow.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 81bbf3a08..64fbd9345 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -295,9 +295,14 @@ MainWindow::MainWindow() new QShortcut(Qt::CTRL + Qt::Key_M, this, SLOT(minimizeOrHide())); new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_M, this, SLOT(hideWindow())); // Control database tabs - new QShortcut(Qt::CTRL + Qt::Key_Tab, this, SLOT(selectNextDatabaseTab())); + // Ctrl+Tab is broken on Mac, so use Alt (i.e. the Option key) - https://bugreports.qt.io/browse/QTBUG-8596 + auto dbTabModifier2 = Qt::CTRL; +#ifdef Q_OS_MACOS + dbTabModifier2 = Qt::ALT; +#endif + new QShortcut(dbTabModifier2 + Qt::Key_Tab, this, SLOT(selectNextDatabaseTab())); new QShortcut(Qt::CTRL + Qt::Key_PageDown, this, SLOT(selectNextDatabaseTab())); - new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Tab, this, SLOT(selectPreviousDatabaseTab())); + new QShortcut(dbTabModifier2 + Qt::SHIFT + Qt::Key_Tab, this, SLOT(selectPreviousDatabaseTab())); new QShortcut(Qt::CTRL + Qt::Key_PageUp, this, SLOT(selectPreviousDatabaseTab())); // Tab selection by number, Windows uses Ctrl, macOS uses Command,