mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Added new submenu in menu bar for OS X to switch tabs with hotkeys.
- Fixed #1176. - https://bugreports.qt.io/browse/QTBUG-8596
This commit is contained in:
parent
c578cd47e1
commit
79a87e740a
1 changed files with 15 additions and 2 deletions
|
@ -346,12 +346,25 @@ void Window::addMenuBar()
|
|||
QMenuBar *mainMenu = new QMenuBar();
|
||||
mainMenu->setNativeMenuBar(true);
|
||||
|
||||
QMenu *menu = new QMenu(QString());
|
||||
mainMenu->addMenu(menu);
|
||||
// First menu.
|
||||
QMenu *menu = mainMenu->addMenu(QString());
|
||||
QAction *prefs = menu->addAction(QString());
|
||||
prefs->setMenuRole(QAction::PreferencesRole);
|
||||
connect(prefs, &QAction::triggered, this,
|
||||
[] { SettingsDialog::showDialog(); });
|
||||
|
||||
// Window menu.
|
||||
QMenu *windowMenu = mainMenu->addMenu(QString("Window"));
|
||||
|
||||
QAction *nextTab = windowMenu->addAction(QString("Select next tab"));
|
||||
nextTab->setShortcuts({QKeySequence("Meta+Tab")});
|
||||
connect(nextTab, &QAction::triggered, this,
|
||||
[=] { this->notebook_->selectNextTab(); });
|
||||
|
||||
QAction *prevTab = windowMenu->addAction(QString("Select previous tab"));
|
||||
prevTab->setShortcuts({QKeySequence("Meta+Shift+Tab")});
|
||||
connect(prevTab, &QAction::triggered, this,
|
||||
[=] { this->notebook_->selectPreviousTab(); });
|
||||
}
|
||||
|
||||
#define UGLYMACROHACK1(s) #s
|
||||
|
|
Loading…
Reference in a new issue