diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/instancemanager.cpp | 4 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 10 | ||||
| -rw-r--r-- | src/moapplication.cpp | 2 | ||||
| -rw-r--r-- | src/settings.cpp | 10 | ||||
| -rw-r--r-- | src/settings.h | 5 | ||||
| -rw-r--r-- | src/settingsdialog.ui | 47 | ||||
| -rw-r--r-- | src/settingsdialoggeneral.cpp | 2 |
7 files changed, 57 insertions, 23 deletions
diff --git a/src/instancemanager.cpp b/src/instancemanager.cpp index e7474584..f2c031d0 100644 --- a/src/instancemanager.cpp +++ b/src/instancemanager.cpp @@ -601,9 +601,7 @@ QString InstanceManager::iniPath(const QString& instanceDir) const std::vector<QString> InstanceManager::globalInstancePaths() const { - const std::set<QString> ignore = { - "cache", "qtwebengine", - }; + const std::set<QString> ignore = { "qtwebengine" }; const QDir root(globalInstancesRootPath()); const auto dirs = root.entryList(QDir::Dirs | QDir::NoDotAndDotDot); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 97d8fd84..81c44c00 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3658,10 +3658,14 @@ void MainWindow::keyReleaseEvent(QKeyEvent *event) { // if the ui is locked, ignore the ALT key event // alt-tabbing out of a game triggers this - if (!UILocker::instance().locked()) { - // if the menubar is hidden, pressing Alt will make it visible + auto& uilocker = UILocker::instance(); + auto& settings = Settings::instance(); + if (!uilocker.locked()) { + // if the menubar is hidden and showMenuBarOnAlt is true, + // pressing Alt will make it visible if (event->key() == Qt::Key_Alt) { - if (!ui->menuBar->isVisible()) { + bool showMenubarOnAlt = settings.interface().showMenubarOnAlt(); + if (showMenubarOnAlt && !ui->menuBar->isVisible()) { ui->menuBar->show(); } } diff --git a/src/moapplication.cpp b/src/moapplication.cpp index 4a6585dd..2e3af26e 100644 --- a/src/moapplication.cpp +++ b/src/moapplication.cpp @@ -160,6 +160,8 @@ MOApplication::MOApplication(int& argc, char** argv) {
TimeThis tt("MOApplication()");
+ qputenv("QML_DISABLE_DISK_CACHE", "true");
+
connect(&m_styleWatcher, &QFileSystemWatcher::fileChanged, [&](auto&& file){
log::debug("style file '{}' changed, reloading", file);
updateStyle(file);
diff --git a/src/settings.cpp b/src/settings.cpp index 1a67407d..c0eb80ca 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -2302,6 +2302,16 @@ void InterfaceSettings::setShowChangeGameConfirmation(bool b) set(m_Settings, "Settings", "show_change_game_confirmation", b); } +bool InterfaceSettings::showMenubarOnAlt() const +{ + return get<bool>(m_Settings, "Settings", "show_menubar_on_alt", true); +} + +void InterfaceSettings::setShowMenubarOnAlt(bool b) +{ + set(m_Settings, "Settings", "show_menubar_on_alt", b); +} + bool InterfaceSettings::doubleClicksOpenPreviews() const { return get<bool>(m_Settings, "Settings", "double_click_previews", true); diff --git a/src/settings.h b/src/settings.h index 6ddee308..d886e806 100644 --- a/src/settings.h +++ b/src/settings.h @@ -688,6 +688,11 @@ public: bool showChangeGameConfirmation() const; void setShowChangeGameConfirmation(bool b); + // whether to show the menubar when pressing the Alt key + // + bool showMenubarOnAlt() const; + void setShowMenubarOnAlt(bool b); + // whether double-clicks on files should try to open previews first // bool doubleClicksOpenPreviews() const; diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 434136ce..a4c9cc7e 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -23,7 +23,7 @@ <attribute name="title"> <string>General</string> </attribute> - <layout class="QGridLayout" name="gridLayout" rowstretch="0"> + <layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0"> <item row="0" column="0"> <widget class="QScrollArea" name="generalScrollArea"> <property name="styleSheet"> @@ -44,8 +44,8 @@ <rect> <x>0</x> <y>0</y> - <width>778</width> - <height>501</height> + <width>780</width> + <height>502</height> </rect> </property> <property name="autoFillBackground"> @@ -95,16 +95,6 @@ </property> </spacer> </item> - <item row="0" column="0"> - <widget class="QComboBox" name="languageBox"> - <property name="toolTip"> - <string>The language of the user interface.</string> - </property> - <property name="whatsThis"> - <string>The language of the user interface.</string> - </property> - </widget> - </item> <item row="0" column="1"> <widget class="LinkLabel" name="label_33"> <property name="toolTip"> @@ -118,6 +108,16 @@ </property> </widget> </item> + <item row="0" column="0"> + <widget class="QComboBox" name="languageBox"> + <property name="toolTip"> + <string>The language of the user interface.</string> + </property> + <property name="whatsThis"> + <string>The language of the user interface.</string> + </property> + </widget> + </item> </layout> </widget> </item> @@ -243,6 +243,19 @@ </widget> </item> <item> + <widget class="QCheckBox" name="showMenubarOnAlt"> + <property name="toolTip"> + <string>Show the menubar when the Alt key is pressed</string> + </property> + <property name="whatsThis"> + <string>Show the menubar when the Alt key is pressed</string> + </property> + <property name="text"> + <string>Show menubar when pressing Alt</string> + </property> + </widget> + </item> + <item> <widget class="QCheckBox" name="doubleClickPreviews"> <property name="toolTip"> <string>Whether double-clicking on a file opens the preview window or launches the program associated with it. This applies to the Data tab as well as the Conflicts and Filetree tabs in the mod info window.</string> @@ -1009,8 +1022,8 @@ If you disable this feature, MO will only display official DLCs this way. Please <rect> <x>0</x> <y>0</y> - <width>778</width> - <height>501</height> + <width>780</width> + <height>502</height> </rect> </property> <property name="autoFillBackground"> @@ -1689,8 +1702,8 @@ If you disable this feature, MO will only display official DLCs this way. Please <rect> <x>0</x> <y>0</y> - <width>778</width> - <height>482</height> + <width>780</width> + <height>483</height> </rect> </property> <property name="autoFillBackground"> diff --git a/src/settingsdialoggeneral.cpp b/src/settingsdialoggeneral.cpp index 27038918..b0f40882 100644 --- a/src/settingsdialoggeneral.cpp +++ b/src/settingsdialoggeneral.cpp @@ -27,6 +27,7 @@ GeneralSettingsTab::GeneralSettingsTab(Settings& s, SettingsDialog& d) // miscellaneous ui->centerDialogs->setChecked(settings().geometry().centerDialogs()); ui->changeGameConfirmation->setChecked(settings().interface().showChangeGameConfirmation()); + ui->showMenubarOnAlt->setChecked(settings().interface().showMenubarOnAlt()); ui->doubleClickPreviews->setChecked(settings().interface().doubleClicksOpenPreviews()); QObject::connect( @@ -60,6 +61,7 @@ void GeneralSettingsTab::update() // miscellaneous settings().geometry().setCenterDialogs(ui->centerDialogs->isChecked()); settings().interface().setShowChangeGameConfirmation(ui->changeGameConfirmation->isChecked()); + settings().interface().setShowMenubarOnAlt(ui->showMenubarOnAlt->isChecked()); settings().interface().setDoubleClicksOpenPreviews(ui->doubleClickPreviews->isChecked()); } |
