diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-03-28 07:55:54 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-03-28 07:55:54 -0600 |
commit | ef2e1bafa7c5f19b0353e0bf01a7ad9d7f8cddf5 (patch) | |
tree | be4372c79a990a4864fcc2567463199794221410 /src/gui/chat.cpp | |
parent | 91da5b104a0895578a0a2a7debbfb495e50ef4f4 (diff) | |
download | mana-client-ef2e1bafa7c5f19b0353e0bf01a7ad9d7f8cddf5.tar.gz mana-client-ef2e1bafa7c5f19b0353e0bf01a7ad9d7f8cddf5.tar.bz2 mana-client-ef2e1bafa7c5f19b0353e0bf01a7ad9d7f8cddf5.tar.xz mana-client-ef2e1bafa7c5f19b0353e0bf01a7ad9d7f8cddf5.zip |
Allow changing chat tabs with the keyboard
Defaults to:
[ for previous tab
] for next tab
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r-- | src/gui/chat.cpp | 22 |
1 files changed, 22 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") |