forked from qt-creator/qt-creator
Beautifier: Fix setting customized style (again)
Amends 4de56e2683
BoolAspect only changes its value if the check box is "clicked", so when
the customized style check box is clicked, the BoolAspect for
usePredefinedStyle does not change its value even though the check box
does.
Fixes: QTCREATORBUG-28525
Change-Id: Ie14c7669c7b41ef1a27dcb5ee69f610b773105fe
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -59,9 +59,6 @@ ClangFormatSettings::ClangFormatSettings()
|
|||||||
fallbackStyle.addOption("WebKit");
|
fallbackStyle.addOption("WebKit");
|
||||||
fallbackStyle.setDefaultValue("Default");
|
fallbackStyle.setDefaultValue("Default");
|
||||||
|
|
||||||
predefinedStyle.setSettingsKey("predefinedStyle");
|
|
||||||
predefinedStyle.setDefaultValue("LLVM");
|
|
||||||
|
|
||||||
customStyle.setSettingsKey("customStyle");
|
customStyle.setSettingsKey("customStyle");
|
||||||
|
|
||||||
documentationFilePath = Core::ICore::userResourcePath(Constants::SETTINGS_DIRNAME)
|
documentationFilePath = Core::ICore::userResourcePath(Constants::SETTINGS_DIRNAME)
|
||||||
@@ -254,7 +251,8 @@ public:
|
|||||||
connect(styleButtonGroup, &QButtonGroup::buttonClicked, this, updateEnabled);
|
connect(styleButtonGroup, &QButtonGroup::buttonClicked, this, updateEnabled);
|
||||||
connect(&s.predefinedStyle, &SelectionAspect::volatileValueChanged, this, updateEnabled);
|
connect(&s.predefinedStyle, &SelectionAspect::volatileValueChanged, this, updateEnabled);
|
||||||
|
|
||||||
setOnApply([settings, configurations] {
|
setOnApply([settings, configurations, customizedStyleButton] {
|
||||||
|
settings->usePredefinedStyle.setValue(!customizedStyleButton->isChecked());
|
||||||
settings->customStyle.setValue(configurations->currentConfiguration());
|
settings->customStyle.setValue(configurations->currentConfiguration());
|
||||||
settings->save();
|
settings->save();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user