aboutsummaryrefslogtreecommitdiff
path: root/gui/dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/dialog.cpp')
-rw-r--r--gui/dialog.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 850c490702..682a36fb2c 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -56,9 +56,8 @@ void Dialog::handleKey(char key, int modifiers)
Widget *w = _firstWidget;
key = toupper(key);
while (w) {
- ButtonWidget *b = dynamic_cast<ButtonWidget *>(w);
- if (b && key == toupper(b->_hotkey)) {
- b->handleClick(1);
+ if (w->_type == kButtonWidget && key == toupper(((ButtonWidget *)w)->_hotkey)) {
+ w->handleClick(1);
break;
}
w = w->_next;