Commit f6a04601949cdcfef33ea67b24c8138201a035f2
1 parent
d29ed9457a
Exists in
master
and in
2 other branches
엔코더 로직 개선
Showing
2 changed files
with
11 additions
and
13 deletions
Show diff stats
app/gui/oven_control/autocookselectionwindow.cpp
@@ -41,6 +41,7 @@ AutoCookSelectionWindow::AutoCookSelectionWindow(QWidget *parent, Define::CookTy | @@ -41,6 +41,7 @@ AutoCookSelectionWindow::AutoCookSelectionWindow(QWidget *parent, Define::CookTy | ||
41 | "border-image: url(:/images/button/288_ov.png);\n" | 41 | "border-image: url(:/images/button/288_ov.png);\n" |
42 | "}"); | 42 | "}"); |
43 | 43 | ||
44 | + QWidget *last = this; | ||
44 | for (int idx = 0; idx < book.list.size(); idx++) | 45 | for (int idx = 0; idx < book.list.size(); idx++) |
45 | { | 46 | { |
46 | int x = 12 + (idx % 3) * 294; | 47 | int x = 12 + (idx % 3) * 294; |
@@ -55,10 +56,16 @@ AutoCookSelectionWindow::AutoCookSelectionWindow(QWidget *parent, Define::CookTy | @@ -55,10 +56,16 @@ AutoCookSelectionWindow::AutoCookSelectionWindow(QWidget *parent, Define::CookTy | ||
55 | sm->setMapping(pb, idx); | 56 | sm->setMapping(pb, idx); |
56 | connect(pb, SIGNAL(clicked()), sm, SLOT(map())); | 57 | connect(pb, SIGNAL(clicked()), sm, SLOT(map())); |
57 | 58 | ||
58 | - if (idx == 0) | ||
59 | - firstEntry = pb; | 59 | + setTabOrder(last, pb); |
60 | + | ||
61 | + last = pb; | ||
60 | } | 62 | } |
61 | 63 | ||
64 | + setTabOrder(last, ui->backButton); | ||
65 | + setTabOrder(ui->backButton, ui->configButton); | ||
66 | + setTabOrder(ui->configButton, ui->washButton); | ||
67 | + setTabOrder(ui->washButton, ui->helpButton); | ||
68 | + | ||
62 | foreach (QPushButton *button, findChildren<QPushButton *>()) | 69 | foreach (QPushButton *button, findChildren<QPushButton *>()) |
63 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); | 70 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
64 | 71 | ||
@@ -147,20 +154,12 @@ void AutoCookSelectionWindow::on_helpButton_clicked() | @@ -147,20 +154,12 @@ void AutoCookSelectionWindow::on_helpButton_clicked() | ||
147 | 154 | ||
148 | void AutoCookSelectionWindow::onEncoderLeft() | 155 | void AutoCookSelectionWindow::onEncoderLeft() |
149 | { | 156 | { |
150 | - QWidget *focused = focusWidget(); | ||
151 | - if (focused == this || focused == firstEntry) | ||
152 | - ui->helpButton->setFocus(); | ||
153 | - else | ||
154 | - focusPreviousChild(); | 157 | + focusPreviousChild(); |
155 | } | 158 | } |
156 | 159 | ||
157 | void AutoCookSelectionWindow::onEncoderRight() | 160 | void AutoCookSelectionWindow::onEncoderRight() |
158 | { | 161 | { |
159 | - QWidget *focused = focusWidget(); | ||
160 | - if (focused == this || focused == ui->helpButton) | ||
161 | - firstEntry->setFocus(); | ||
162 | - else | ||
163 | - focusNextChild(); | 162 | + focusNextChild(); |
164 | } | 163 | } |
165 | 164 | ||
166 | void AutoCookSelectionWindow::onEncoderClicked(QWidget *clicked) | 165 | void AutoCookSelectionWindow::onEncoderClicked(QWidget *clicked) |
app/gui/oven_control/autocookselectionwindow.h