mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-23 02:42:16 -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
|
// Menu settings
|
||||||
showShortcutsCheckBox.setChecked(settings.getShowShortcuts());
|
showShortcutsCheckBox.setChecked(settings.getShowShortcuts());
|
||||||
|
connect(&showShortcutsCheckBox, &QCheckBox::QT_STATE_CHANGED, this, &AppearanceSettingsPage::showShortcutsChanged);
|
||||||
|
|
||||||
auto *menuGrid = new QGridLayout;
|
auto *menuGrid = new QGridLayout;
|
||||||
menuGrid->addWidget(&showShortcutsCheckBox, 0, 0);
|
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()
|
void AppearanceSettingsPage::retranslateUi()
|
||||||
{
|
{
|
||||||
themeGroupBox->setTitle(tr("Theme settings"));
|
themeGroupBox->setTitle(tr("Theme settings"));
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ class AppearanceSettingsPage : public AbstractSettingsPage
|
||||||
private slots:
|
private slots:
|
||||||
void themeBoxChanged(int index);
|
void themeBoxChanged(int index);
|
||||||
void openThemeLocation();
|
void openThemeLocation();
|
||||||
|
void showShortcutsChanged(QT_STATE_CHANGED_T enabled);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QLabel themeLabel;
|
QLabel themeLabel;
|
||||||
|
|
|
||||||
|
|
@ -180,6 +180,9 @@ int main(int argc, char *argv[])
|
||||||
ui.show();
|
ui.show();
|
||||||
qDebug("main(): ui.show() finished");
|
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))
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue