From 54af8ce9c6d972580d2935498e563988450b94f6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 2 Feb 2014 16:49:27 +0300 Subject: add actions for select next/previous tab in shortcuts window. --- src/gui/widgets/tabbedarea.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/gui/widgets/tabbedarea.cpp') 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(mTabs.size())) + tab = 0; + setSelectedTab(mTabs[tab].first); +} + +void TabbedArea::selectPrevTab() +{ + int tab = getSelectedTabIndex(); + + if (tab == 0) + tab = static_cast(mTabs.size()); + tab--; + setSelectedTab(mTabs[tab].first); +} -- cgit v1.2.3-70-g09d2