diff --git a/app/gui/oven_control/cooldownpopup.cpp b/app/gui/oven_control/cooldownpopup.cpp index 658e124..170028b 100644 --- a/app/gui/oven_control/cooldownpopup.cpp +++ b/app/gui/oven_control/cooldownpopup.cpp @@ -137,11 +137,23 @@ void CooldownPopup::showCurrentTemp() void CooldownPopup::updateView() { + QWidget *focused = focusWidget(); + ui->tempButton->setChecked(focused == ui->tempSlider); + int temp; if (showingCurrentTemp) temp = oven->currentTemp(); - else + else if (ui->tempSlider->isSliderDown() || focusWidget() == ui->tempSlider) temp = ui->tempSlider->sliderPosition(); + else + temp = ui->tempSlider->value(); + + if (ui->tempSlider->sliderPosition() != temp) + { + ui->tempSlider->blockSignals(true); + ui->tempSlider->setSliderPosition(temp); + ui->tempSlider->blockSignals(false); + } ui->tempCurrentLabel->setText(Stringer::temperature(temp, Stringer::fontSize14)); @@ -299,17 +311,21 @@ void CooldownPopup::onEncoderRight() void CooldownPopup::onEncoderClicked(QWidget *clicked) { if (clicked == ui->background) + { close(); - else if (clicked->inherits("QPushButton")) + return; + } + + QPushButton *b = qobject_cast(clicked); + if (b) { - QPushButton *b = qobject_cast(clicked); - if (b) - b->click(); + b->click(); + return; } - else if (clicked->inherits("Slider")) + + Slider *slider = qobject_cast(clicked); + if (slider) { - Slider *slider = qobject_cast(clicked); - if (slider == ui->tempSlider) - ui->tempButton->setFocus(); + ui->tempButton->setFocus(); } } diff --git a/app/gui/oven_control/cooldownpopup.ui b/app/gui/oven_control/cooldownpopup.ui index 8672879..efb5fd0 100644 --- a/app/gui/oven_control/cooldownpopup.ui +++ b/app/gui/oven_control/cooldownpopup.ui @@ -100,11 +100,16 @@ height: 33px; QPushButton { image: url(:/images/slider_icon/cooldown.png); } -QPushButton::pressed, QPushButton:focus { image: url(:/images/slider_icon/cooldown_ov.png); } +QPushButton:pressed, +QPushButton:focus { image: url(:/images/slider_icon/mark_01_icon_active.png); } +QPushButton:checked { image: url(:/images/slider_icon/cooldown_ov.png); } + + true + icon @@ -360,6 +365,9 @@ QPushButton:pressed, QPushButton:focus { background-image: url(:/images/cooldown 140 + + Qt::ClickFocus +