mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Merge pull request #1178 from 23rd/patch-29-mac-ctrl-tab
Added new submenu in menu bar for OS X to switch tabs with hotkeys.
This commit is contained in:
commit
0c245fbc4e
|
@ -344,12 +344,25 @@ void Window::addMenuBar()
|
||||||
QMenuBar *mainMenu = new QMenuBar();
|
QMenuBar *mainMenu = new QMenuBar();
|
||||||
mainMenu->setNativeMenuBar(true);
|
mainMenu->setNativeMenuBar(true);
|
||||||
|
|
||||||
QMenu *menu = new QMenu(QString());
|
// First menu.
|
||||||
mainMenu->addMenu(menu);
|
QMenu *menu = mainMenu->addMenu(QString());
|
||||||
QAction *prefs = menu->addAction(QString());
|
QAction *prefs = menu->addAction(QString());
|
||||||
prefs->setMenuRole(QAction::PreferencesRole);
|
prefs->setMenuRole(QAction::PreferencesRole);
|
||||||
connect(prefs, &QAction::triggered, this,
|
connect(prefs, &QAction::triggered, this,
|
||||||
[] { SettingsDialog::showDialog(); });
|
[] { 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
|
#define UGLYMACROHACK1(s) #s
|
||||||
|
|
Loading…
Reference in a new issue