Auto set "remove superfluous empty lines" spinbox enable state with the checkbox

This commit is contained in:
Roy Qu 2024-04-27 12:21:23 +08:00
parent ad6873614b
commit 9ef7d45640
1 changed files with 4 additions and 0 deletions

View File

@ -31,6 +31,9 @@ FormatterGeneralWidget::FormatterGeneralWidget(const QString& name, const QStrin
connect(this, &SettingsWidget::settingsChanged,
this, &FormatterGeneralWidget::updateDemo);
connect(ui->chkSqueezeEmptyLines, &QCheckBox::toggled,
ui->spinSqueezeEmptyLines, &QSpinBox::setEnabled);
ui->cbMinConditionalIndent->addItem(tr("No minimal indent"),0);
ui->cbMinConditionalIndent->addItem(tr("Indent at least one additional indent"),1);
ui->cbMinConditionalIndent->addItem(tr("Indent at least two additional indents"),2);
@ -99,6 +102,7 @@ void FormatterGeneralWidget::doLoad()
ui->chkDeleteEmptyLines->setChecked(format.deleteEmptyLines());
ui->chkFillEmptyLines->setChecked(format.fillEmptyLines());
ui->chkSqueezeEmptyLines->setChecked(format.squeezeLines());
ui->spinSqueezeEmptyLines->setEnabled(format.squeezeLines());
ui->spinSqueezeEmptyLines->setValue(format.squeezeLinesNumber());
ui->chkSqueezeWhitespace->setChecked(format.squeezeWhitespace());
switch(format.alignPointerStyle()) {