mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-20 17:32:15 -07:00
wire stuff up
This commit is contained in:
parent
b0638daa6c
commit
d88d694bf3
3 changed files with 12 additions and 0 deletions
|
|
@ -326,6 +326,8 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
|||
|
||||
// Menu settings
|
||||
showShortcutsCheckBox.setChecked(settings.getShowShortcuts());
|
||||
connect(&showShortcutsCheckBox, &QCheckBox::QT_STATE_CHANGED, this, &AppearanceSettingsPage::showShortcutsChanged);
|
||||
|
||||
auto *menuGrid = new QGridLayout;
|
||||
menuGrid->addWidget(&showShortcutsCheckBox, 0, 0);
|
||||
|
||||
|
|
@ -426,6 +428,12 @@ void AppearanceSettingsPage::openThemeLocation()
|
|||
}
|
||||
}
|
||||
|
||||
void AppearanceSettingsPage::showShortcutsChanged(QT_STATE_CHANGED_T value)
|
||||
{
|
||||
SettingsCache::instance().setShowShortcuts(value);
|
||||
qApp->setAttribute(Qt::AA_DontShowShortcutsInContextMenus, value == 0); // 0 = unchecked
|
||||
}
|
||||
|
||||
void AppearanceSettingsPage::retranslateUi()
|
||||
{
|
||||
themeGroupBox->setTitle(tr("Theme settings"));
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ class AppearanceSettingsPage : public AbstractSettingsPage
|
|||
private slots:
|
||||
void themeBoxChanged(int index);
|
||||
void openThemeLocation();
|
||||
void showShortcutsChanged(QT_STATE_CHANGED_T enabled);
|
||||
|
||||
private:
|
||||
QLabel themeLabel;
|
||||
|
|
|
|||
|
|
@ -180,6 +180,9 @@ int main(int argc, char *argv[])
|
|||
ui.show();
|
||||
qDebug("main(): ui.show() finished");
|
||||
|
||||
// If enabled, force shortcuts to be shown in right-click menus regardless of system defaults
|
||||
qApp->setAttribute(Qt::AA_DontShowShortcutsInContextMenus, !SettingsCache::instance().getShowShortcuts());
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue