aboutsummaryrefslogtreecommitdiff
path: root/gui/widgets
diff options
context:
space:
mode:
authorBastien Bouclet2017-08-06 17:53:57 +0200
committerBastien Bouclet2017-08-06 17:55:33 +0200
commitf5b335af100c84d2ad761548825548d6fe3be125 (patch)
tree09bc90ef40d55492989fb48ab9102548dbe8bbad /gui/widgets
parent8e5ac98a4b6082caf68ad205dc6cadffa4df5051 (diff)
downloadscummvm-rg350-f5b335af100c84d2ad761548825548d6fe3be125.tar.gz
scummvm-rg350-f5b335af100c84d2ad761548825548d6fe3be125.tar.bz2
scummvm-rg350-f5b335af100c84d2ad761548825548d6fe3be125.zip
GUI: Mark some fall-through cases as intentional
Comments explain how the num lock handling works before the fall-through cases.
Diffstat (limited to 'gui/widgets')
-rw-r--r--gui/widgets/list.cpp7
-rw-r--r--gui/widgets/popup.cpp4
2 files changed, 11 insertions, 0 deletions
diff --git a/gui/widgets/list.cpp b/gui/widgets/list.cpp
index 48d181e5ec..e5690fb6f2 100644
--- a/gui/widgets/list.cpp
+++ b/gui/widgets/list.cpp
@@ -359,6 +359,7 @@ bool ListWidget::handleKeyDown(Common::KeyState state) {
handled = false;
break;
}
+ // fall through
case Common::KEYCODE_BACKSPACE:
case Common::KEYCODE_DELETE:
if (_selectedItem >= 0) {
@@ -375,6 +376,7 @@ bool ListWidget::handleKeyDown(Common::KeyState state) {
handled = false;
break;
}
+ // fall through
case Common::KEYCODE_END:
_selectedItem = _list.size() - 1;
break;
@@ -385,6 +387,7 @@ bool ListWidget::handleKeyDown(Common::KeyState state) {
handled = false;
break;
}
+ // fall through
case Common::KEYCODE_DOWN:
if (_selectedItem < (int)_list.size() - 1)
_selectedItem++;
@@ -395,6 +398,7 @@ bool ListWidget::handleKeyDown(Common::KeyState state) {
handled = false;
break;
}
+ // fall through
case Common::KEYCODE_PAGEDOWN:
_selectedItem += _entriesPerPage - 1;
if (_selectedItem >= (int)_list.size() )
@@ -406,6 +410,7 @@ bool ListWidget::handleKeyDown(Common::KeyState state) {
handled = false;
break;
}
+ // fall through
case Common::KEYCODE_HOME:
_selectedItem = 0;
break;
@@ -415,6 +420,7 @@ bool ListWidget::handleKeyDown(Common::KeyState state) {
handled = false;
break;
}
+ // fall through
case Common::KEYCODE_UP:
if (_selectedItem > 0)
_selectedItem--;
@@ -425,6 +431,7 @@ bool ListWidget::handleKeyDown(Common::KeyState state) {
handled = false;
break;
}
+ // fall through
case Common::KEYCODE_PAGEUP:
_selectedItem -= _entriesPerPage - 1;
if (_selectedItem < 0)
diff --git a/gui/widgets/popup.cpp b/gui/widgets/popup.cpp
index 82f4112a97..74fbc44823 100644
--- a/gui/widgets/popup.cpp
+++ b/gui/widgets/popup.cpp
@@ -234,6 +234,7 @@ void PopUpDialog::handleKeyDown(Common::KeyState state) {
case Common::KEYCODE_KP1:
if (state.flags & Common::KBD_NUM)
break;
+ // fall through
case Common::KEYCODE_END:
setSelection(_popUpBoss->_entries.size()-1);
break;
@@ -241,6 +242,7 @@ void PopUpDialog::handleKeyDown(Common::KeyState state) {
case Common::KEYCODE_KP2:
if (state.flags & Common::KBD_NUM)
break;
+ // fall through
case Common::KEYCODE_DOWN:
moveDown();
break;
@@ -248,6 +250,7 @@ void PopUpDialog::handleKeyDown(Common::KeyState state) {
case Common::KEYCODE_KP7:
if (state.flags & Common::KBD_NUM)
break;
+ // fall through
case Common::KEYCODE_HOME:
setSelection(0);
break;
@@ -255,6 +258,7 @@ void PopUpDialog::handleKeyDown(Common::KeyState state) {
case Common::KEYCODE_KP8:
if (state.flags & Common::KBD_NUM)
break;
+ // fall through
case Common::KEYCODE_UP:
moveUp();
break;