Compare commits

...

2 Commits

Author SHA1 Message Date
5253dc1df6 Implement monitor reset button 2020-07-17 18:49:28 +02:00
4bdedbc110 Add missing header 2020-07-17 18:44:22 +02:00
2 changed files with 11 additions and 0 deletions

View File

@ -5,6 +5,7 @@
#include <cmath> #include <cmath>
#include <QAbstractButton>
#include <QCloseEvent> #include <QCloseEvent>
#include <QGroupBox> #include <QGroupBox>
#include <QSlider> #include <QSlider>
@ -116,6 +117,7 @@ void MainWindow::setupMonitorsTab()
{ {
connect(m_ui.monitorDropdown, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &MainWindow::updateCurrentMonitorGUI); connect(m_ui.monitorDropdown, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &MainWindow::updateCurrentMonitorGUI);
connect(m_ui.monitorEnumerateButton, &QAbstractButton::clicked, [this](bool) { enumMonitors(); }); connect(m_ui.monitorEnumerateButton, &QAbstractButton::clicked, [this](bool) { enumMonitors(); });
connect(m_ui.monitorResetButton, &QAbstractButton::clicked, [this](bool) { resetAllMonitorSettings(); });
setupLimitsSlider(); setupLimitsSlider();
setupOverallLimitsSlider(); setupOverallLimitsSlider();
@ -265,6 +267,13 @@ void MainWindow::setupCallbackTimer()
qDebug(ltr("Callback timer started")); 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) void MainWindow::updateCurrentMonitorGUI(int index)
{ {
if(index == -1) { if(index == -1) {

View File

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