diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-02 16:49:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-02 16:49:27 +0300 |
commit | 54af8ce9c6d972580d2935498e563988450b94f6 (patch) | |
tree | 4e870df77b37c22f874704ab0cbbd554cde79507 /src/gui/widgets | |
parent | 81bd48dee406603164f35170bb2aa1e82c9fc338 (diff) | |
download | manaverse-54af8ce9c6d972580d2935498e563988450b94f6.tar.gz manaverse-54af8ce9c6d972580d2935498e563988450b94f6.tar.bz2 manaverse-54af8ce9c6d972580d2935498e563988450b94f6.tar.xz manaverse-54af8ce9c6d972580d2935498e563988450b94f6.zip |
add actions for select next/previous tab in shortcuts window.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/tabbedarea.cpp | 19 | ||||
-rw-r--r-- | src/gui/widgets/tabbedarea.h | 4 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index da6c89d1a..3b0cf1db5 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -725,3 +725,22 @@ void TabbedArea::death(const gcn::Event &event) else gcn::BasicContainer::death(event); } + +void TabbedArea::selectNextTab() +{ + int tab = getSelectedTabIndex(); + tab++; + if (tab == static_cast<int>(mTabs.size())) + tab = 0; + setSelectedTab(mTabs[tab].first); +} + +void TabbedArea::selectPrevTab() +{ + int tab = getSelectedTabIndex(); + + if (tab == 0) + tab = static_cast<int>(mTabs.size()); + tab--; + setSelectedTab(mTabs[tab].first); +} diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index eaac7a6d5..d0f97b688 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -189,6 +189,10 @@ class TabbedArea final : public Widget2, void adjustWidget(gcn::Widget *const widget) const; + void selectNextTab(); + + void selectPrevTab(); + private: typedef std::vector <std::pair<Tab*, gcn::Widget*> > TabContainer; |