Skip to content

Commit

Permalink
Merge pull request #177 from Jiogo18/webcam
Browse files Browse the repository at this point in the history
Fix Webcam checkbox flicker & Use Checkbox::clicked signal
  • Loading branch information
dmitry-s93 authored Jun 15, 2024
2 parents 969db69 + 470cee1 commit 9d1a328
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
13 changes: 8 additions & 5 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ void MainWindow::updateUsbPowerShareState() {
ui->usbPowerShareCheckBox->setChecked(operate.getUsbPowerShareState());
}

void MainWindow::updateWebCamState() {
void MainWindow::updateWebCamState() const {
ui->webCamCheckBox->setChecked(operate.getWebCamState());
}

Expand Down Expand Up @@ -646,19 +646,22 @@ void MainWindow::on_WriteValueButton_clicked() const {
operate.setValue(address, ui->ValueSpinBox->value());
}

void MainWindow::on_usbPowerShareCheckBox_toggled(bool checked) const {
void MainWindow::on_usbPowerShareCheckBox_clicked(bool checked) const {
operate.setUsbPowerShareState(checked);
}

void MainWindow::on_webCamCheckBox_toggled(bool checked) const {
void MainWindow::on_webCamCheckBox_clicked(bool checked) const {
operate.setWebCamState(checked);
if (operate.updateEcData()) {
updateWebCamState();
}
}

void MainWindow::on_fnSuperSwapCheckBox_toggled(bool checked) const {
void MainWindow::on_fnSuperSwapCheckBox_clicked(bool checked) const {
operate.setFnSuperSwapState(checked);
}

void MainWindow::on_coolerBoostCheckBox_toggled(bool checked) const {
void MainWindow::on_coolerBoostCheckBox_clicked(bool checked) const {
if (operate.getCoolerBoostState() != checked)
setCoolerBoostState(checked);
}
Expand Down
10 changes: 5 additions & 5 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Q_OBJECT
void updateKeyboardBacklightMode();
void updateKeyboardBrightness();
void updateUsbPowerShareState();
void updateWebCamState();
void updateWebCamState() const;
void updateFnSuperSwapState();
void updateCoolerBoostState() const;
void updateUserMode();
Expand Down Expand Up @@ -125,12 +125,12 @@ private slots:

void on_WriteValueButton_clicked() const;

void on_usbPowerShareCheckBox_toggled(bool checked) const;
void on_webCamCheckBox_toggled(bool checked) const;
void on_usbPowerShareCheckBox_clicked(bool checked) const;
void on_webCamCheckBox_clicked(bool checked) const;

void on_fnSuperSwapCheckBox_toggled(bool checked) const;
void on_fnSuperSwapCheckBox_clicked(bool checked) const;

void on_coolerBoostCheckBox_toggled(bool checked) const;
void on_coolerBoostCheckBox_clicked(bool checked) const;

void on_keyboardBrightnessSlider_valueChanged(int value) const;

Expand Down

0 comments on commit 9d1a328

Please sign in to comment.