From 10d2268c2891a8b6dfc2552240ad25497f8ee85b Mon Sep 17 00:00:00 2001 From: taehoon Date: Fri, 13 Dec 2019 17:06:37 +0900 Subject: [PATCH] V1.5.01 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 요청 사항 반영 - 실행 알람 시인성 강화 --- app/gui/oven_control/define.h | 2 +- app/gui/oven_control/manualcookwindow.cpp | 80 ++++++++++++++++++++----------- app/gui/oven_control/manualcookwindow.h | 2 +- app/gui/oven_control/manualcookwindow.ui | 11 +++-- 4 files changed, 61 insertions(+), 34 deletions(-) diff --git a/app/gui/oven_control/define.h b/app/gui/oven_control/define.h index be99004..68bded0 100644 --- a/app/gui/oven_control/define.h +++ b/app/gui/oven_control/define.h @@ -5,7 +5,7 @@ #define MAJOR_VER 1 #define MINOR_VER 5 -#define HOTFIX_VER 00 +#define HOTFIX_VER 01 // 0 for normal // 1 for premium diff --git a/app/gui/oven_control/manualcookwindow.cpp b/app/gui/oven_control/manualcookwindow.cpp index 0fa862d..990e7cb 100644 --- a/app/gui/oven_control/manualcookwindow.cpp +++ b/app/gui/oven_control/manualcookwindow.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "soundplayer.h" #include "preheatpopup.h" @@ -158,9 +159,14 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : connect(oven, SIGNAL(changed(Oven*)), this, SLOT(onOvenUpdated(Oven*))); oven->setDefault(mode); + QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect(this); + effect->setBlurRadius(10); + effect->setOffset(3, 3); + ui->infoTextLabel->setAttribute(Qt::WA_TransparentForMouseEvents); + ui->infoTextLabel->setGraphicsEffect(effect); ui->infoTextLabel->hide(); - showInfoTextTimer.setInterval(1500); + showInfoTextTimer.setInterval(1000); showInfoTextTimer.setSingleShot(true); connect(&updateViewTimer, SIGNAL(timeout()), SLOT(updateView())); @@ -457,9 +463,9 @@ QPushButton:checked\ ui->damperButton->setChecked(damper); if (damper) - showInfoText("ON"); + showInfoText("ON", ":/images/manual_button/damper_open.png"); else - showInfoText("OFF"); + showInfoText("OFF", ":/images/manual_button/damper_close.png"); } bool humidification = oven->humidification(); @@ -469,9 +475,9 @@ QPushButton:checked\ qDebug() << "humidification" << humidification; if (humidification) - showInfoText("ON"); + showInfoText("ON", ":/images/manual_button/side_nozzle_open.png"); else - showInfoText("OFF"); + showInfoText("OFF", ":/images/manual_button/side_nozzle_close.png"); } QString fanStyleSheet("\ @@ -523,9 +529,9 @@ QPushButton:focus { background-image: url(%2); }"); ui->repeatButton->setChecked(repeat); if (repeat) - showInfoText("ON"); + showInfoText("ON", ":/images/manual_button/repeat_ov.png"); else - showInfoText("OFF"); + showInfoText("OFF", ":/images/manual_button/repeat.png"); } if (cookDone) @@ -544,22 +550,10 @@ QPushButton:focus { background-image: url(%2); }"); } int remainingTime = showInfoTextTimer.remainingTime(); - if (remainingTime > 500) - { - ui->infoTextLabel->setStyleSheet("color: rgb(255, 255, 255);"); - ui->infoTextLabel->show(); - } - else if (remainingTime > 0) - { - ui->infoTextLabel->setStyleSheet( - QString("color: rgba(255, 255, 255, %1);") - .arg(qBound(0, remainingTime * 255 / 500, 255))); + if (remainingTime > 0) ui->infoTextLabel->show(); - } else - { ui->infoTextLabel->hide(); - } } void ManualCookWindow::showCurrentHumidity() @@ -586,9 +580,14 @@ void ManualCookWindow::hideCurrentTemp() updateView(); } -void ManualCookWindow::showInfoText(QString text) +void ManualCookWindow::showInfoText(QString text, QString icon) { - ui->infoTextLabel->setText(text); + + QString textTemplate = QString( + "" + " %1").arg(text).arg(icon); + + ui->infoTextLabel->setText(textTemplate); showInfoTextTimer.start(); } @@ -1036,7 +1035,30 @@ void ManualCookWindow::on_fanButton_clicked() oven->setFan(fan); - showInfoText(QString("%1").arg(fan)); + QString text = QString("%1").arg(fan); + QString icon; + switch (fan) + { + case 1: + icon = ":/images/manual_button/fan_1.png"; + break; + case 2: + icon = ":/images/manual_button/fan_2.png"; + break; + case 3: + icon = ":/images/manual_button/fan_3.png"; + break; + case 4: + icon = ":/images/manual_button/fan_4.png"; + break; + case 5: + icon = ":/images/manual_button/fan_5.png"; + break; + default: + break; + } + + showInfoText(text, icon); } void ManualCookWindow::on_preheatButton_clicked() @@ -1056,12 +1078,12 @@ void ManualCookWindow::on_damperButton_clicked() if (oven->damper()) { oven->closeDamper(); - showInfoText("OFF"); + showInfoText("OFF", ":/images/manual_button/damper_close.png"); } else { oven->openDamper(); - showInfoText("ON"); + showInfoText("ON", ":/images/manual_button/damper_open.png"); } } @@ -1070,12 +1092,12 @@ void ManualCookWindow::on_humidificationButton_clicked() if (oven->humidification()) { oven->stopHumidification(); - showInfoText("OFF"); + showInfoText("OFF", ":/images/manual_button/side_nozzle_close.png"); } else { oven->startHumidification(5); - showInfoText("ON"); + showInfoText("ON", ":/images/manual_button/side_nozzle_open.png"); } } @@ -1084,13 +1106,13 @@ void ManualCookWindow::on_repeatButton_clicked() if (repeat) { repeat = false; - showInfoText("OFF"); + showInfoText("OFF", ":/images/manual_button/repeat.png"); updateView(); } else { repeat = true; - showInfoText("ON"); + showInfoText("ON", ":/images/manual_button/repeat_ov.png"); updateView(); repeatSetting.mode = oven->mode(); diff --git a/app/gui/oven_control/manualcookwindow.h b/app/gui/oven_control/manualcookwindow.h index 6a15bed..c35d461 100644 --- a/app/gui/oven_control/manualcookwindow.h +++ b/app/gui/oven_control/manualcookwindow.h @@ -41,7 +41,7 @@ private slots: void hideCurrentHumidity(); void showCurrentTemp(); void hideCurrentTemp(); - void showInfoText(QString text); + void showInfoText(QString text, QString icon); void onOvenUpdated(Oven *oven); diff --git a/app/gui/oven_control/manualcookwindow.ui b/app/gui/oven_control/manualcookwindow.ui index f7c5d36..8d43884 100644 --- a/app/gui/oven_control/manualcookwindow.ui +++ b/app/gui/oven_control/manualcookwindow.ui @@ -1311,16 +1311,21 @@ QPushButton:checked:focus - 48 + 52 75 true - color: rgba(255, 255, 255, 255); + background-image: url(:/images/error/background.png); +background-repeat: no-repeat; +background-position: center center; +border-radius: 40px; +color: rgba(255, 255, 255, 255); +margin: 200px 300px; - ON + <img src=":/images/manual_button/fan_1.png"/><span>1</span> Qt::AlignCenter -- 2.1.4