Added Preferences item in menu bar for OS X.
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
#include <QMenuBar>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
@@ -43,6 +44,10 @@ Window::Window(WindowType type)
|
|||||||
this->addShortcuts();
|
this->addShortcuts();
|
||||||
this->addLayout();
|
this->addLayout();
|
||||||
|
|
||||||
|
#ifdef Q_OS_MACOS
|
||||||
|
this->addMenuBar();
|
||||||
|
#endif
|
||||||
|
|
||||||
this->signalHolder_.managedConnect(
|
this->signalHolder_.managedConnect(
|
||||||
getApp()->accounts->twitch.currentUserChanged,
|
getApp()->accounts->twitch.currentUserChanged,
|
||||||
[this] { this->onAccountSelected(); });
|
[this] { this->onAccountSelected(); });
|
||||||
@@ -336,6 +341,18 @@ void Window::addShortcuts()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Window::addMenuBar()
|
||||||
|
{
|
||||||
|
QMenuBar *mainMenu = new QMenuBar();
|
||||||
|
mainMenu->setNativeMenuBar(true);
|
||||||
|
|
||||||
|
QMenu *menu = new QMenu(QString());
|
||||||
|
mainMenu->addMenu(menu);
|
||||||
|
QAction *prefs = menu->addAction(QString());
|
||||||
|
prefs->setMenuRole(QAction::PreferencesRole);
|
||||||
|
connect(prefs, &QAction::triggered, this, [] { SettingsDialog::showDialog(); });
|
||||||
|
}
|
||||||
|
|
||||||
#define UGLYMACROHACK1(s) #s
|
#define UGLYMACROHACK1(s) #s
|
||||||
#define UGLYMACROHACK(s) UGLYMACROHACK1(s)
|
#define UGLYMACROHACK(s) UGLYMACROHACK1(s)
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ private:
|
|||||||
void addShortcuts();
|
void addShortcuts();
|
||||||
void addLayout();
|
void addLayout();
|
||||||
void onAccountSelected();
|
void onAccountSelected();
|
||||||
|
void addMenuBar();
|
||||||
|
|
||||||
WindowType type_;
|
WindowType type_;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user