mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[Client] Settings: add top-right cogwheel shortcut
Add a subtle flat settings button to the tab bar corner that opens the settings dialog via the existing menu action slot. Icon and tooltip follow the menu action in retranslateUi.
This commit is contained in:
parent
da56a37506
commit
39e8c132aa
2 changed files with 13 additions and 0 deletions
|
|
@ -82,10 +82,12 @@
|
|||
#include <QPixmapCache>
|
||||
#include <QPushButton>
|
||||
#include <QSharedPointer>
|
||||
#include <QSize>
|
||||
#include <QStatusBar>
|
||||
#include <QStringLiteral>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QTimer>
|
||||
#include <QToolButton>
|
||||
#include <QWidget>
|
||||
#include <QtConcurrentRun>
|
||||
#include <QtGlobal>
|
||||
|
|
@ -355,6 +357,8 @@ void MainWindow::retranslateUi()
|
|||
aForgotPassword->setText(tr("&Restore password..."));
|
||||
aSettings->setText(tr("&Settings..."));
|
||||
aSettings->setIcon(themePixmap(QStringLiteral("icons/settings")));
|
||||
settingsButton->setToolTip(tr("Settings"));
|
||||
settingsButton->setIcon(themePixmap(QStringLiteral("icons/settings")));
|
||||
aExit->setText(tr("&Exit"));
|
||||
|
||||
#if defined(__APPLE__) /* For OSX */
|
||||
|
|
@ -559,6 +563,13 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
|
||||
setCentralWidget(tabSupervisor);
|
||||
|
||||
// Subtle settings entry in the tab bar corner, mirroring the menu action
|
||||
settingsButton = new QToolButton(tabSupervisor);
|
||||
settingsButton->setAutoRaise(true);
|
||||
settingsButton->setIconSize(QSize(20, 20));
|
||||
connect(settingsButton, &QToolButton::clicked, this, &MainWindow::actSettings);
|
||||
tabSupervisor->setCornerWidget(settingsButton, Qt::TopRightCorner);
|
||||
|
||||
retranslateUi();
|
||||
|
||||
if (!restoreGeometry(SettingsCache::instance().layouts().getMainWindowGeometry())) {
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@
|
|||
#include <qtmetamacros.h>
|
||||
|
||||
class QAction;
|
||||
class QToolButton;
|
||||
class QWidget;
|
||||
struct LocalGameOptions;
|
||||
|
||||
|
|
@ -178,6 +179,7 @@ private:
|
|||
QList<QMenu *> tabMenus;
|
||||
QMenu *cockatriceMenu, *dbMenu, *tabsMenu, *helpMenu, *trayIconMenu;
|
||||
QAction *aAbout, *aSettings, *aShow, *aExit;
|
||||
QToolButton *settingsButton = nullptr;
|
||||
QAction *aConnect, *aDisconnect, *aRegister, *aForgotPassword, *aSinglePlayer, *aWatchReplay, *aFullScreen;
|
||||
QAction *aManageSets, *aEditTokens, *aOpenCustomFolder, *aOpenCustomsetsFolder, *aAddCustomSet,
|
||||
*aReloadCardDatabase;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue