ClangFormat: Grey out Clang-Format Style config when not overridden

Add feature to grey out the Clang-Format Style configuration widget
after unchecking the 'Override' checkbox.

Change-Id: I94bbb1f4436f3caeaed55d49582211257e480d0d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Artem Sokolovskii
2023-04-04 14:28:27 +02:00
parent 42c653b53c
commit 028686b419
10 changed files with 46 additions and 12 deletions

View File

@@ -89,7 +89,8 @@ ClangFormatConfigWidget::ClangFormatConfigWidget(TextEditor::ICodeStylePreferenc
d->checksScrollArea->setWidget(d->checksWidget);
d->checksScrollArea->setWidgetResizable(true);
d->checksWidget->setEnabled(!codeStyle->isReadOnly());
d->checksWidget->setEnabled(!codeStyle->isReadOnly()
&& !codeStyle->isTemporarilyReadOnly());
FilePath fileName;
if (d->project)
@@ -140,7 +141,8 @@ void ClangFormatConfigWidget::slotCodeStyleChanged(
d->config->setIsReadOnly(codeStyle->isReadOnly());
d->style = d->config->style();
d->checksWidget->setEnabled(!codeStyle->isReadOnly());
d->checksWidget->setEnabled(!codeStyle->isReadOnly()
&& !codeStyle->isTemporarilyReadOnly());
fillTable();
updatePreview();