mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-22 03:45:51 +08:00
feat: check for "--disable-mica" arg to disable Mica effect
This commit is contained in:
@@ -46,6 +46,7 @@ SettingsWidget::SettingsWidget(QWidget *parent) : QDialog{parent}
|
||||
{
|
||||
#ifdef WIN32
|
||||
m_backDropTypeCombo = nullptr;
|
||||
m_disableMicaCheckBox = nullptr;
|
||||
#endif
|
||||
setupUI();
|
||||
loadSettings();
|
||||
@@ -144,6 +145,10 @@ void SettingsWidget::setupUI()
|
||||
backDropTypeLayout->addStretch();
|
||||
|
||||
generalLayout->addLayout(backDropTypeLayout);
|
||||
|
||||
m_disableMicaCheckBox =
|
||||
new QCheckBox("Disable Mica effects (also disables WinUI styles)");
|
||||
generalLayout->addWidget(m_disableMicaCheckBox);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -350,6 +355,9 @@ void SettingsWidget::loadSettings()
|
||||
m_backDropTypeCombo->setCurrentIndex(0);
|
||||
}
|
||||
}
|
||||
if (m_disableMicaCheckBox) {
|
||||
m_disableMicaCheckBox->setChecked(sm->disableMica());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -426,6 +434,12 @@ void SettingsWidget::connectSignals()
|
||||
onSettingChanged();
|
||||
});
|
||||
}
|
||||
if (m_disableMicaCheckBox) {
|
||||
connect(m_disableMicaCheckBox, &QCheckBox::toggled, this, [this]() {
|
||||
m_restartRequired = true;
|
||||
onSettingChanged();
|
||||
});
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -534,6 +548,9 @@ void SettingsWidget::saveSettings()
|
||||
sm->setWinBackdropType(static_cast<WIN_BACKDROP>(data.toInt()));
|
||||
}
|
||||
}
|
||||
if (m_disableMicaCheckBox) {
|
||||
sm->setDisableMica(m_disableMicaCheckBox->isChecked());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user