Implement monitor reset button

This commit is contained in:
BlackMark 2020-07-17 18:49:28 +02:00
parent 4bdedbc110
commit 5253dc1df6
2 changed files with 10 additions and 0 deletions

View File

@ -117,6 +117,7 @@ void MainWindow::setupMonitorsTab()
{
connect(m_ui.monitorDropdown, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &MainWindow::updateCurrentMonitorGUI);
connect(m_ui.monitorEnumerateButton, &QAbstractButton::clicked, [this](bool) { enumMonitors(); });
connect(m_ui.monitorResetButton, &QAbstractButton::clicked, [this](bool) { resetAllMonitorSettings(); });
setupLimitsSlider();
setupOverallLimitsSlider();
@ -266,6 +267,13 @@ void MainWindow::setupCallbackTimer()
qDebug(ltr("Callback timer started"));
}
void MainWindow::resetAllMonitorSettings()
{
m_ui.monitorOverallMinBrightnessSlider->setValue(0);
m_ui.monitorOverallMaxBrightnessSlider->setValue(100);
m_ui.monitorOverallOverrideCheck->setCheckState(Qt::CheckState::Unchecked);
}
void MainWindow::updateCurrentMonitorGUI(int index)
{
if(index == -1) {

View File

@ -43,6 +43,8 @@ class MainWindow : public QMainWindow {
void setupTrayIcon();
void setupCallbackTimer();
void resetAllMonitorSettings();
void updateCurrentMonitorGUI(int index);
void updateState();