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 | 41 | "border-image: url(:/images/button/288_ov.png);\n" |
| 42 | 42 | "}"); |
| 43 | 43 | |
| 44 | + QWidget *last = this; | |
| 44 | 45 | for (int idx = 0; idx < book.list.size(); idx++) |
| 45 | 46 | { |
| 46 | 47 | int x = 12 + (idx % 3) * 294; |
| ... | ... | @@ -55,10 +56,16 @@ AutoCookSelectionWindow::AutoCookSelectionWindow(QWidget *parent, Define::CookTy |
| 55 | 56 | sm->setMapping(pb, idx); |
| 56 | 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 | 69 | foreach (QPushButton *button, findChildren<QPushButton *>()) |
| 63 | 70 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
| 64 | 71 | |
| ... | ... | @@ -147,20 +154,12 @@ void AutoCookSelectionWindow::on_helpButton_clicked() |
| 147 | 154 | |
| 148 | 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 | 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 | 165 | void AutoCookSelectionWindow::onEncoderClicked(QWidget *clicked) | ... | ... |