diff --git a/AdaptiveBrightness/main_window.cpp b/AdaptiveBrightness/main_window.cpp index 30c4521..8277944 100644 --- a/AdaptiveBrightness/main_window.cpp +++ b/AdaptiveBrightness/main_window.cpp @@ -87,6 +87,17 @@ void MainWindow::loadIcons() void MainWindow::setupMonitorsTab() { + m_ui.monitorBrightnessSlider->setDisabled(true); + m_ui.monitorOverallBrightnessSlider->setDisabled(true); + + m_ui.monitorOverrideCheck->setChecked(false); + connect(m_ui.monitorOverrideCheck, &QCheckBox::stateChanged, + [this](int state) { m_ui.monitorBrightnessSlider->setEnabled(state == Qt::CheckState::Checked); }); + + m_ui.monitorOverallOverrideCheck->setChecked(false); + connect(m_ui.monitorOverallOverrideCheck, &QCheckBox::stateChanged, + [this](int state) { m_ui.monitorOverallBrightnessSlider->setEnabled(state == Qt::CheckState::Checked); }); + connect(m_ui.monitorBrightnessSlider, &QSlider::valueChanged, [this](int value) { const auto mappedBrightness = utils::map(value, 0, 100, 0.f, 1.f); const auto newBrightness = std::clamp(mappedBrightness, 0.f, 1.f);