From 8f4dec0bff6feb1813d2fff894161821f207ffac Mon Sep 17 00:00:00 2001 From: BlackMark Date: Fri, 17 Jul 2020 16:15:52 +0200 Subject: [PATCH] Implement overall limit sliders --- AdaptiveBrightness/main_window.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/AdaptiveBrightness/main_window.cpp b/AdaptiveBrightness/main_window.cpp index d836258..bbc9522 100644 --- a/AdaptiveBrightness/main_window.cpp +++ b/AdaptiveBrightness/main_window.cpp @@ -127,6 +127,19 @@ void MainWindow::setupMonitorsTab() qDebug(ltr("Overriding brightness with %1").arg(newBrightness)); m_brightness = newBrightness; }); + + connect(m_ui.monitorOverallMinBrightnessSlider, &QSlider::valueChanged, [this](int value) { + m_ui.monitorOverallMinBrightnessValueLabel->setText(tr("%1%").arg(value, 3)); + if(value > m_ui.monitorOverallMaxBrightnessSlider->value()) { + m_ui.monitorOverallMaxBrightnessSlider->setValue(value); + } + }); + connect(m_ui.monitorOverallMaxBrightnessSlider, &QSlider::valueChanged, [this](int value) { + m_ui.monitorOverallMaxBrightnessValueLabel->setText(tr("%1%").arg(value, 3)); + if(value < m_ui.monitorOverallMinBrightnessSlider->value()) { + m_ui.monitorOverallMinBrightnessSlider->setValue(value); + } + }); } void MainWindow::setupTrayIcon()