diff options
Diffstat (limited to 'src/gui/widgets/windowcontainer.cpp')
-rw-r--r-- | src/gui/widgets/windowcontainer.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/widgets/windowcontainer.cpp b/src/gui/widgets/windowcontainer.cpp index cba565cc4..d420e1183 100644 --- a/src/gui/widgets/windowcontainer.cpp +++ b/src/gui/widgets/windowcontainer.cpp @@ -58,6 +58,26 @@ void WindowContainer::adjustAfterResize(const int oldScreenWidth, } } +void WindowContainer::moveWidgetAfter(gcn::Widget *const after, + gcn::Widget *const widget) +{ + WidgetListIterator widgetIter = std::find( + mWidgets.begin(), mWidgets.end(), widget); + + if (widgetIter == mWidgets.end()) + return; + + WidgetListIterator afterIter = std::find( + mWidgets.begin(), mWidgets.end(), after); + + if (afterIter == mWidgets.end()) + return; + + ++ afterIter; + mWidgets.erase(widgetIter); + mWidgets.insert(afterIter, widget); +} + #ifdef USE_PROFILER void WindowContainer::draw(gcn::Graphics* graphics) { |