summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/windows/chatwindow.cpp18
-rw-r--r--src/gui/windows/chatwindow.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 49ef73907..c3b78f066 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -374,6 +374,24 @@ void ChatWindow::nextTab()
mChatTabs->setSelectedTabByIndex(tab);
}
+void ChatWindow::selectGeneralTab()
+{
+ if (!mChatTabs)
+ return;
+
+ int sz = mChatTabs->getNumberOfTabs();
+ for (int f = 0; f < sz; f ++)
+ {
+ ChatTab *const tab = dynamic_cast<ChatTab*>(
+ mChatTabs->getTabByIndex(f));
+ if (tab && tab->getType() == ChatTabType::INPUT)
+ {
+ mChatTabs->setSelectedTab(tab);
+ break;
+ }
+ }
+}
+
void ChatWindow::closeTab() const
{
if (!mChatTabs)
diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h
index 7287410d9..d4dfa602d 100644
--- a/src/gui/windows/chatwindow.h
+++ b/src/gui/windows/chatwindow.h
@@ -285,6 +285,8 @@ class ChatWindow final : public Window,
bool isTabPresent(const ChatTab *const tab) const A_WARN_UNUSED;
+ void selectGeneralTab();
+
void attributeChanged(const int id,
const int oldVal,
const int newVal) override final;