From c45e77fbc83f0cca785e3708c4507ad167c8c214 Mon Sep 17 00:00:00 2001 From: Matthias Kuehlewein Date: Fri, 13 Dec 2024 11:29:25 +0100 Subject: [PATCH] TextSymbolSettings: Fix initial state of standard buttons When entering the text symbol settings dialog the 'OK' and 'Reset' buttons where initially enabled. Don't misuse the framingCheckClicked() function to enable/disable the framing_widget tab in updateGeneralContents() as framingCheckClicked() will signal modified properties. --- src/gui/symbols/text_symbol_settings.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/gui/symbols/text_symbol_settings.cpp b/src/gui/symbols/text_symbol_settings.cpp index a793cec13..da13ece3f 100644 --- a/src/gui/symbols/text_symbol_settings.cpp +++ b/src/gui/symbols/text_symbol_settings.cpp @@ -1,6 +1,6 @@ /* * Copyright 2012, 2013 Thomas Schöps - * Copyright 2012-2019 Kai Pastor + * Copyright 2012-2019, 2024 Kai Pastor * * This file is part of OpenOrienteering. * @@ -39,14 +39,13 @@ #include #include #include -#include #include #include #include #include #include #include -#include +// IWYU pragma: no_include #include #include @@ -84,9 +83,9 @@ SymbolPropertiesWidget* TextSymbol::createPropertiesWidget(SymbolSettingDialog* // ### TextSymbolSettings ### TextSymbolSettings::TextSymbolSettings(TextSymbol* symbol, SymbolSettingDialog* dialog) -: SymbolPropertiesWidget(symbol, dialog), - symbol(symbol), - dialog(dialog) +: SymbolPropertiesWidget(symbol, dialog) +, symbol(symbol) +, dialog(dialog) { auto map = dialog->getPreviewMap(); react_to_changes = true; @@ -543,10 +542,10 @@ void TextSymbolSettings::updateGeneralContents() kerning_check->setChecked(symbol->kerning); icon_text_edit->setText(symbol->getIconText()); framing_check->setChecked(symbol->framing); + setTabEnabled(indexOf(framing_widget), symbol->framing); ocad_compat_check->setChecked(symbol->line_below || symbol->getNumCustomTabs() > 0); react_to_changes = true; - framingCheckClicked(framing_check->isChecked()); ocadCompatibilityButtonClicked(ocad_compat_check->isChecked()); }