ClangFormat: Fix code style preferences are grayed out

Code style preferences are grayed out even when formatting mode
is set to disable.

Fixes: QTCREATORBUG-29129
Change-Id: Icf82fa0751f9291122c2af55111b6bd5fac85c7b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Artem Sokolovskii
2023-05-08 11:00:04 +02:00
parent 2455ff28cd
commit 7960c1f3f6
7 changed files with 51 additions and 19 deletions

View File

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