Commit 10d2268c2891a8b6dfc2552240ad25497f8ee85b
1 parent
a128c1aad7
Exists in
master
and in
2 other branches
V1.5.01
요청 사항 반영 - 실행 알람 시인성 강화
Showing
4 changed files
with
61 additions
and
34 deletions
Show diff stats
app/gui/oven_control/define.h
app/gui/oven_control/manualcookwindow.cpp
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | #include <QSignalMapper> |
| 5 | 5 | #include <QTimer> |
| 6 | 6 | #include <QtDebug> |
| 7 | +#include <QGraphicsDropShadowEffect> | |
| 7 | 8 | |
| 8 | 9 | #include "soundplayer.h" |
| 9 | 10 | #include "preheatpopup.h" |
| ... | ... | @@ -158,9 +159,14 @@ ManualCookWindow::ManualCookWindow(QWidget *parent, Define::Mode mode) : |
| 158 | 159 | connect(oven, SIGNAL(changed(Oven*)), this, SLOT(onOvenUpdated(Oven*))); |
| 159 | 160 | oven->setDefault(mode); |
| 160 | 161 | |
| 162 | + QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect(this); | |
| 163 | + effect->setBlurRadius(10); | |
| 164 | + effect->setOffset(3, 3); | |
| 165 | + | |
| 161 | 166 | ui->infoTextLabel->setAttribute(Qt::WA_TransparentForMouseEvents); |
| 167 | + ui->infoTextLabel->setGraphicsEffect(effect); | |
| 162 | 168 | ui->infoTextLabel->hide(); |
| 163 | - showInfoTextTimer.setInterval(1500); | |
| 169 | + showInfoTextTimer.setInterval(1000); | |
| 164 | 170 | showInfoTextTimer.setSingleShot(true); |
| 165 | 171 | |
| 166 | 172 | connect(&updateViewTimer, SIGNAL(timeout()), SLOT(updateView())); |
| ... | ... | @@ -457,9 +463,9 @@ QPushButton:checked\ |
| 457 | 463 | ui->damperButton->setChecked(damper); |
| 458 | 464 | |
| 459 | 465 | if (damper) |
| 460 | - showInfoText("ON"); | |
| 466 | + showInfoText("ON", ":/images/manual_button/damper_open.png"); | |
| 461 | 467 | else |
| 462 | - showInfoText("OFF"); | |
| 468 | + showInfoText("OFF", ":/images/manual_button/damper_close.png"); | |
| 463 | 469 | } |
| 464 | 470 | |
| 465 | 471 | bool humidification = oven->humidification(); |
| ... | ... | @@ -469,9 +475,9 @@ QPushButton:checked\ |
| 469 | 475 | qDebug() << "humidification" << humidification; |
| 470 | 476 | |
| 471 | 477 | if (humidification) |
| 472 | - showInfoText("ON"); | |
| 478 | + showInfoText("ON", ":/images/manual_button/side_nozzle_open.png"); | |
| 473 | 479 | else |
| 474 | - showInfoText("OFF"); | |
| 480 | + showInfoText("OFF", ":/images/manual_button/side_nozzle_close.png"); | |
| 475 | 481 | } |
| 476 | 482 | |
| 477 | 483 | QString fanStyleSheet("\ |
| ... | ... | @@ -523,9 +529,9 @@ QPushButton:focus { background-image: url(%2); }"); |
| 523 | 529 | ui->repeatButton->setChecked(repeat); |
| 524 | 530 | |
| 525 | 531 | if (repeat) |
| 526 | - showInfoText("ON"); | |
| 532 | + showInfoText("ON", ":/images/manual_button/repeat_ov.png"); | |
| 527 | 533 | else |
| 528 | - showInfoText("OFF"); | |
| 534 | + showInfoText("OFF", ":/images/manual_button/repeat.png"); | |
| 529 | 535 | } |
| 530 | 536 | |
| 531 | 537 | if (cookDone) |
| ... | ... | @@ -544,22 +550,10 @@ QPushButton:focus { background-image: url(%2); }"); |
| 544 | 550 | } |
| 545 | 551 | |
| 546 | 552 | int remainingTime = showInfoTextTimer.remainingTime(); |
| 547 | - if (remainingTime > 500) | |
| 548 | - { | |
| 549 | - ui->infoTextLabel->setStyleSheet("color: rgb(255, 255, 255);"); | |
| 550 | - ui->infoTextLabel->show(); | |
| 551 | - } | |
| 552 | - else if (remainingTime > 0) | |
| 553 | - { | |
| 554 | - ui->infoTextLabel->setStyleSheet( | |
| 555 | - QString("color: rgba(255, 255, 255, %1);") | |
| 556 | - .arg(qBound(0, remainingTime * 255 / 500, 255))); | |
| 553 | + if (remainingTime > 0) | |
| 557 | 554 | ui->infoTextLabel->show(); |
| 558 | - } | |
| 559 | 555 | else |
| 560 | - { | |
| 561 | 556 | ui->infoTextLabel->hide(); |
| 562 | - } | |
| 563 | 557 | } |
| 564 | 558 | |
| 565 | 559 | void ManualCookWindow::showCurrentHumidity() |
| ... | ... | @@ -586,9 +580,14 @@ void ManualCookWindow::hideCurrentTemp() |
| 586 | 580 | updateView(); |
| 587 | 581 | } |
| 588 | 582 | |
| 589 | -void ManualCookWindow::showInfoText(QString text) | |
| 583 | +void ManualCookWindow::showInfoText(QString text, QString icon) | |
| 590 | 584 | { |
| 591 | - ui->infoTextLabel->setText(text); | |
| 585 | + | |
| 586 | + QString textTemplate = QString( | |
| 587 | + "<img src=\"%2\" />" | |
| 588 | + "<span> %1</span>").arg(text).arg(icon); | |
| 589 | + | |
| 590 | + ui->infoTextLabel->setText(textTemplate); | |
| 592 | 591 | showInfoTextTimer.start(); |
| 593 | 592 | } |
| 594 | 593 | |
| ... | ... | @@ -1036,7 +1035,30 @@ void ManualCookWindow::on_fanButton_clicked() |
| 1036 | 1035 | |
| 1037 | 1036 | oven->setFan(fan); |
| 1038 | 1037 | |
| 1039 | - showInfoText(QString("%1").arg(fan)); | |
| 1038 | + QString text = QString("%1").arg(fan); | |
| 1039 | + QString icon; | |
| 1040 | + switch (fan) | |
| 1041 | + { | |
| 1042 | + case 1: | |
| 1043 | + icon = ":/images/manual_button/fan_1.png"; | |
| 1044 | + break; | |
| 1045 | + case 2: | |
| 1046 | + icon = ":/images/manual_button/fan_2.png"; | |
| 1047 | + break; | |
| 1048 | + case 3: | |
| 1049 | + icon = ":/images/manual_button/fan_3.png"; | |
| 1050 | + break; | |
| 1051 | + case 4: | |
| 1052 | + icon = ":/images/manual_button/fan_4.png"; | |
| 1053 | + break; | |
| 1054 | + case 5: | |
| 1055 | + icon = ":/images/manual_button/fan_5.png"; | |
| 1056 | + break; | |
| 1057 | + default: | |
| 1058 | + break; | |
| 1059 | + } | |
| 1060 | + | |
| 1061 | + showInfoText(text, icon); | |
| 1040 | 1062 | } |
| 1041 | 1063 | |
| 1042 | 1064 | void ManualCookWindow::on_preheatButton_clicked() |
| ... | ... | @@ -1056,12 +1078,12 @@ void ManualCookWindow::on_damperButton_clicked() |
| 1056 | 1078 | if (oven->damper()) |
| 1057 | 1079 | { |
| 1058 | 1080 | oven->closeDamper(); |
| 1059 | - showInfoText("OFF"); | |
| 1081 | + showInfoText("OFF", ":/images/manual_button/damper_close.png"); | |
| 1060 | 1082 | } |
| 1061 | 1083 | else |
| 1062 | 1084 | { |
| 1063 | 1085 | oven->openDamper(); |
| 1064 | - showInfoText("ON"); | |
| 1086 | + showInfoText("ON", ":/images/manual_button/damper_open.png"); | |
| 1065 | 1087 | } |
| 1066 | 1088 | } |
| 1067 | 1089 | |
| ... | ... | @@ -1070,12 +1092,12 @@ void ManualCookWindow::on_humidificationButton_clicked() |
| 1070 | 1092 | if (oven->humidification()) |
| 1071 | 1093 | { |
| 1072 | 1094 | oven->stopHumidification(); |
| 1073 | - showInfoText("OFF"); | |
| 1095 | + showInfoText("OFF", ":/images/manual_button/side_nozzle_close.png"); | |
| 1074 | 1096 | } |
| 1075 | 1097 | else |
| 1076 | 1098 | { |
| 1077 | 1099 | oven->startHumidification(5); |
| 1078 | - showInfoText("ON"); | |
| 1100 | + showInfoText("ON", ":/images/manual_button/side_nozzle_open.png"); | |
| 1079 | 1101 | } |
| 1080 | 1102 | } |
| 1081 | 1103 | |
| ... | ... | @@ -1084,13 +1106,13 @@ void ManualCookWindow::on_repeatButton_clicked() |
| 1084 | 1106 | if (repeat) |
| 1085 | 1107 | { |
| 1086 | 1108 | repeat = false; |
| 1087 | - showInfoText("OFF"); | |
| 1109 | + showInfoText("OFF", ":/images/manual_button/repeat.png"); | |
| 1088 | 1110 | updateView(); |
| 1089 | 1111 | } |
| 1090 | 1112 | else |
| 1091 | 1113 | { |
| 1092 | 1114 | repeat = true; |
| 1093 | - showInfoText("ON"); | |
| 1115 | + showInfoText("ON", ":/images/manual_button/repeat_ov.png"); | |
| 1094 | 1116 | updateView(); |
| 1095 | 1117 | |
| 1096 | 1118 | repeatSetting.mode = oven->mode(); | ... | ... |
app/gui/oven_control/manualcookwindow.h
app/gui/oven_control/manualcookwindow.ui
| ... | ... | @@ -1311,16 +1311,21 @@ QPushButton:checked:focus |
| 1311 | 1311 | </property> |
| 1312 | 1312 | <property name="font"> |
| 1313 | 1313 | <font> |
| 1314 | - <pointsize>48</pointsize> | |
| 1314 | + <pointsize>52</pointsize> | |
| 1315 | 1315 | <weight>75</weight> |
| 1316 | 1316 | <bold>true</bold> |
| 1317 | 1317 | </font> |
| 1318 | 1318 | </property> |
| 1319 | 1319 | <property name="styleSheet"> |
| 1320 | - <string notr="true">color: rgba(255, 255, 255, 255);</string> | |
| 1320 | + <string notr="true">background-image: url(:/images/error/background.png); | |
| 1321 | +background-repeat: no-repeat; | |
| 1322 | +background-position: center center; | |
| 1323 | +border-radius: 40px; | |
| 1324 | +color: rgba(255, 255, 255, 255); | |
| 1325 | +margin: 200px 300px;</string> | |
| 1321 | 1326 | </property> |
| 1322 | 1327 | <property name="text"> |
| 1323 | - <string>ON</string> | |
| 1328 | + <string><img src=":/images/manual_button/fan_1.png"/><span>1</span></string> | |
| 1324 | 1329 | </property> |
| 1325 | 1330 | <property name="alignment"> |
| 1326 | 1331 | <set>Qt::AlignCenter</set> | ... | ... |