From e16db1823da721743841f1ecb200b1c9bb581bbd Mon Sep 17 00:00:00 2001 From: AdenKoperczak Date: Tue, 29 Oct 2024 11:25:16 -0400 Subject: [PATCH] Add disabling of theme file when custom theme is not selected --- scwx-qt/source/scwx/qt/ui/settings_dialog.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp b/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp index 20616204..2d129355 100644 --- a/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp +++ b/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp @@ -528,10 +528,24 @@ void SettingsDialogImpl::SetupGeneralTab() types::GetUiStyleName); theme_.SetResetButton(self_->ui->resetThemeButton); + QObject::connect( + self_->ui->themeComboBox, + &QComboBox::currentTextChanged, + self_, + [this](const QString& text) + { + types::UiStyle style = types::GetUiStyle(text.toStdString()); + bool themeFileEnabled = style == types::UiStyle::FusionCustom; + + self_->ui->themeFileLineEdit->setEnabled(themeFileEnabled); + self_->ui->themeFileSelectButton->setEnabled(themeFileEnabled); + self_->ui->resetThemeFileButton->setEnabled(themeFileEnabled); + }); + themeFile_.SetSettingsVariable(generalSettings.theme_file()); themeFile_.SetEditWidget(self_->ui->themeFileLineEdit); themeFile_.SetResetButton(self_->ui->resetThemeFileButton); - //themeFile_.EnableTrimming(); + themeFile_.EnableTrimming(); QObject::connect( self_->ui->themeFileSelectButton,