From d270789002ac3c7011684be7de03a4e3339caa64 Mon Sep 17 00:00:00 2001 From: Reg Tiangha Date: Mon, 23 Sep 2024 10:57:32 -0600 Subject: [PATCH] lime_qt: Group QT macro version checks together --- .../configuration/configure_layout.cpp | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/lime_qt/configuration/configure_layout.cpp b/src/lime_qt/configuration/configure_layout.cpp index a0109e4ec..c19e53f3d 100644 --- a/src/lime_qt/configuration/configure_layout.cpp +++ b/src/lime_qt/configuration/configure_layout.cpp @@ -49,47 +49,45 @@ ConfigureLayout::ConfigureLayout(QWidget* parent) }); ui->screen_top_leftright_padding->setEnabled(Settings::values.screen_top_stretch.GetValue()); + #if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) connect(ui->screen_top_stretch, static_cast(&QCheckBox::stateChanged), this, [this](bool checkState) { ui->screen_top_leftright_padding->setEnabled(checkState); }); -#else - connect(ui->screen_top_stretch, &QCheckBox::checkStateChanged, this, - [this](bool checkState) { ui->screen_top_leftright_padding->setEnabled(checkState); }); -#endif ui->screen_top_topbottom_padding->setEnabled(Settings::values.screen_top_stretch.GetValue()); -#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) connect(ui->screen_top_stretch, static_cast(&QCheckBox::stateChanged), this, [this](bool checkState) { ui->screen_top_topbottom_padding->setEnabled(checkState); }); -#else - connect(ui->screen_top_stretch, &QCheckBox::checkStateChanged, this, - [this](bool checkState) { ui->screen_top_topbottom_padding->setEnabled(checkState); }); -#endif ui->screen_bottom_leftright_padding->setEnabled( Settings::values.screen_bottom_topbottom_padding.GetValue()); -#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) connect( ui->screen_bottom_stretch, static_cast(&QCheckBox::stateChanged), this, [this](bool checkState) { ui->screen_bottom_leftright_padding->setEnabled(checkState); }); -#else - connect( - ui->screen_bottom_stretch, &QCheckBox::checkStateChanged, this, - [this](bool checkState) { ui->screen_bottom_leftright_padding->setEnabled(checkState); }); -#endif ui->screen_bottom_topbottom_padding->setEnabled( Settings::values.screen_bottom_topbottom_padding.GetValue()); -#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) connect( ui->screen_bottom_stretch, static_cast(&QCheckBox::stateChanged), this, [this](bool checkState) { ui->screen_bottom_topbottom_padding->setEnabled(checkState); }); #else + connect(ui->screen_top_stretch, &QCheckBox::checkStateChanged, this, + [this](bool checkState) { ui->screen_top_leftright_padding->setEnabled(checkState); }); + ui->screen_top_topbottom_padding->setEnabled(Settings::values.screen_top_stretch.GetValue()); + connect(ui->screen_top_stretch, &QCheckBox::checkStateChanged, this, + [this](bool checkState) { ui->screen_top_topbottom_padding->setEnabled(checkState); }); + ui->screen_bottom_leftright_padding->setEnabled( + Settings::values.screen_bottom_topbottom_padding.GetValue()); + connect( + ui->screen_bottom_stretch, &QCheckBox::checkStateChanged, this, + [this](bool checkState) { ui->screen_bottom_leftright_padding->setEnabled(checkState); }); + ui->screen_bottom_topbottom_padding->setEnabled( + Settings::values.screen_bottom_topbottom_padding.GetValue()); connect( ui->screen_bottom_stretch, &QCheckBox::checkStateChanged, this, [this](bool checkState) { ui->screen_bottom_topbottom_padding->setEnabled(checkState); }); #endif + connect(ui->bg_button, &QPushButton::clicked, this, [this] { const QColor new_bg_color = QColorDialog::getColor(bg_color); if (!new_bg_color.isValid()) {