diff options
Diffstat (limited to 'src/gui/focushandler.cpp')
-rw-r--r-- | src/gui/focushandler.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/gui/focushandler.cpp b/src/gui/focushandler.cpp index de10fece..9a0ba6b4 100644 --- a/src/gui/focushandler.cpp +++ b/src/gui/focushandler.cpp @@ -21,6 +21,8 @@ #include "focushandler.h" +#include "gui/widgets/window.h" + void FocusHandler::requestModalFocus(gcn::Widget *widget) { /* If there is another widget with modal focus, remove its modal focus @@ -60,3 +62,38 @@ void FocusHandler::remove(gcn::Widget *widget) gcn::FocusHandler::remove(widget); } + +void FocusHandler::tabNext() +{ + gcn::FocusHandler::tabNext(); + + checkForWindow(); +} + +void FocusHandler::tabPrevious() +{ + gcn::FocusHandler::tabPrevious(); + + checkForWindow(); +} + +void FocusHandler::checkForWindow() +{ + if (mFocusedWidget) + { + gcn::Widget *widget = mFocusedWidget->getParent(); + + while (widget) + { + Window *window = dynamic_cast<Window*>(widget); + + if (window) + { + window->requestMoveToTop(); + break; + } + + widget = widget->getParent(); + } + } +} |