Add option to always show menu bar instead of toolbar

For those who like keyboard navigation at the expense of aesthetics.
This commit is contained in:
Kenneth Chew
2022-04-15 18:25:37 -04:00
parent f6605bc3f8
commit 1303771b58
5 changed files with 51 additions and 11 deletions

View File

@ -41,6 +41,7 @@
#include <QMessageBox>
#include <QDir>
#include <QTextCharFormat>
#include <QMenuBar>
#include "updater/UpdateChecker.h"
@ -322,6 +323,8 @@ void LauncherPage::applySettings()
APPLICATION->setApplicationTheme(newAppTheme, false);
}
s->set("MenuBarInsteadOfToolBar", ui->preferMenuBarCheckBox->isChecked());
// Console settings
s->set("ShowConsole", ui->showConsoleCheck->isChecked());
s->set("AutoCloseConsole", ui->autoCloseConsoleCheck->isChecked());
@ -410,6 +413,10 @@ void LauncherPage::loadSettings()
}
}
// Toolbar/menu bar settings (not applicable if native menu bar is present)
ui->toolsBox->setVisible(!QMenuBar().isNativeMenuBar());
ui->preferMenuBarCheckBox->setChecked(s->get("MenuBarInsteadOfToolBar").toBool());
// Console settings
ui->showConsoleCheck->setChecked(s->get("ShowConsole").toBool());
ui->autoCloseConsoleCheck->setChecked(s->get("AutoCloseConsole").toBool());

View File

@ -290,6 +290,16 @@
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Colors</string>
</property>
<property name="buddy">
<cstring>themeComboBoxColors</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="themeComboBoxColors">
<property name="sizePolicy">
@ -303,13 +313,25 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="toolsBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Tools</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="preferMenuBarCheckBox">
<property name="text">
<string>Colors</string>
</property>
<property name="buddy">
<cstring>themeComboBoxColors</cstring>
<string>Always show menu bar instead of tool bar (more keyboard friendly, less pretty)</string>
</property>
</widget>
</item>