summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/chat.cpp22
-rw-r--r--src/gui/chat.h10
2 files changed, 32 insertions, 0 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 987de11e..398b5792 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -159,6 +159,28 @@ void ChatWindow::clearTab()
clearTab(getFocused());
}
+void ChatWindow::prevTab()
+{
+ int tab = mChatTabs->getSelectedTabIndex();
+
+ if (tab == 0)
+ tab = mChatTabs->getNumberOfTabs();
+ tab--;
+
+ mChatTabs->setSelectedTab(tab);
+}
+
+void ChatWindow::nextTab()
+{
+ int tab = mChatTabs->getSelectedTabIndex();
+
+ tab++;
+ if (tab == mChatTabs->getNumberOfTabs())
+ tab = 0;
+
+ mChatTabs->setSelectedTab(tab);
+}
+
void ChatWindow::action(const gcn::ActionEvent &event)
{
if (event.getId() == "chatinput")
diff --git a/src/gui/chat.h b/src/gui/chat.h
index 54270055..3a2f7fdb 100644
--- a/src/gui/chat.h
+++ b/src/gui/chat.h
@@ -103,6 +103,16 @@ class ChatWindow : public Window,
void clearTab();
/**
+ * Switch to the previous tab in order
+ */
+ void prevTab();
+
+ /**
+ * Switch to the next tab in order
+ */
+ void nextTab();
+
+ /**
* Performs action.
*/
void action(const gcn::ActionEvent &event);