GUI: Add Tab cycling to TabWidget
Tab and Shift-Tab can now cycle between each Tab of the Edit Game menu.
This commit is contained in:
parent
d91c8b9add
commit
80d34a8a7c
3 changed files with 38 additions and 4 deletions
|
@ -250,7 +250,18 @@ void Dialog::handleKeyDown(Common::KeyState state) {
|
|||
close();
|
||||
}
|
||||
|
||||
// TODO: tab/shift-tab should focus the next/previous focusable widget
|
||||
if (state.keycode == Common::KEYCODE_TAB) {
|
||||
// TODO: Maybe add Tab behaviours for all widgets too.
|
||||
// searches through widgets on screen for tab widget
|
||||
Widget *w = _firstWidget;
|
||||
while (w) {
|
||||
if (w->_type == kTabWidget)
|
||||
if (w->handleKeyDown(state))
|
||||
return;
|
||||
|
||||
w = w->_next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Dialog::handleKeyUp(Common::KeyState state) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue