Skip to content

Commit 47e6727

Browse files
committed
fix(appearance): always use system title bar on macOS
Hide the System title bar checkbox on macOS and force the option on, since a frameless window is unusual on that platform.
1 parent 1ebe9be commit 47e6727

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

src/core/sessionconfig.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,14 @@ QuickAccessOpenMode SessionConfig::stringToOpenMode(const QString &p_str) {
304304
return QuickAccessOpenMode::Default;
305305
}
306306

307-
bool SessionConfig::getSystemTitleBarEnabled() const { return m_systemTitleBarEnabled; }
307+
bool SessionConfig::getSystemTitleBarEnabled() const {
308+
#if defined(Q_OS_MACOS)
309+
// On macOS, always use the system title bar; the option is hidden in settings.
310+
return true;
311+
#else
312+
return m_systemTitleBarEnabled;
313+
#endif
314+
}
308315

309316
void SessionConfig::setSystemTitleBarEnabled(bool p_enabled) {
310317
updateConfig(m_systemTitleBarEnabled, p_enabled, this);

src/widgets/dialogs/settings/appearancepage.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,19 @@ void AppearancePage::setupUI() {
3131

3232
auto *cardLayout = SettingsPageHelper::addSection(mainLayout, tr("Appearance"), QString(), this);
3333

34+
#if !defined(Q_OS_MACOS)
35+
// On macOS the system title bar is always used, so this option is hidden.
3436
{
3537
const QString label(tr("System title bar"));
3638
m_systemTitleBarCheckBox = WidgetsFactory::createCheckBox(label, this);
3739
m_systemTitleBarCheckBox->setToolTip(tr("Use system title bar"));
38-
cardLayout->addWidget(
39-
SettingsPageHelper::createCheckBoxRow(m_systemTitleBarCheckBox,
40-
m_systemTitleBarCheckBox->toolTip(), this));
40+
cardLayout->addWidget(SettingsPageHelper::createCheckBoxRow(
41+
m_systemTitleBarCheckBox, m_systemTitleBarCheckBox->toolTip(), this));
4142
addSearchItem(label, m_systemTitleBarCheckBox->toolTip(), m_systemTitleBarCheckBox);
4243
connect(m_systemTitleBarCheckBox, &QCheckBox::stateChanged, this,
4344
&AppearancePage::pageIsChangedWithRestartNeeded);
4445
}
46+
#endif
4547

4648
{
4749
m_toolBarIconSizeSpinBox = WidgetsFactory::createSpinBox(this);
@@ -52,9 +54,8 @@ void AppearancePage::setupUI() {
5254

5355
const QString label(tr("Main tool bar icon size"));
5456
cardLayout->addWidget(SettingsPageHelper::createSeparator(this));
55-
cardLayout->addWidget(
56-
SettingsPageHelper::createSettingRow(label, m_toolBarIconSizeSpinBox->toolTip(),
57-
m_toolBarIconSizeSpinBox, this));
57+
cardLayout->addWidget(SettingsPageHelper::createSettingRow(
58+
label, m_toolBarIconSizeSpinBox->toolTip(), m_toolBarIconSizeSpinBox, this));
5859
addSearchItem(label, m_toolBarIconSizeSpinBox->toolTip(), m_toolBarIconSizeSpinBox);
5960
connect(m_toolBarIconSizeSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), this,
6061
&AppearancePage::pageIsChangedWithRestartNeeded);

0 commit comments

Comments
 (0)