Implement manual override checkboxes
This commit is contained in:
parent
69a68ce67c
commit
7b791a071b
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user