Commit dd60b75c authored by Maximilian Schiller's avatar Maximilian Schiller
Browse files

Reraise the active sesson after renaming a session

This patch gives focus back to the currently active terminal after
renaming a session with either the context menu or the shortcut.

Whenever a tab title is edited signal to the sessionstack to raise the
active session.

BUG: 408374
parent 57b3a1c2
......@@ -117,6 +117,9 @@ MainWindow::MainWindow(QWidget* parent)
connect(m_tabBar, SIGNAL(lastTabClosed()), this, SLOT(handleLastTabClosed()));
connect(m_tabBar, SIGNAL(tabSelected(int)), m_sessionStack, SLOT(raiseSession(int)));
connect(m_tabBar, SIGNAL(tabClosed(int)), m_sessionStack, SLOT(removeSession(int)));
connect(m_tabBar, &TabBar::tabTitleEdited, m_sessionStack, [&](int , QString) {
m_sessionStack->raiseSession(m_sessionStack->activeSessionId());
});
connect(m_tabBar, SIGNAL(requestTerminalHighlight(int)), m_sessionStack, SLOT(handleTerminalHighlightRequest(int)));
connect(m_tabBar, SIGNAL(requestRemoveTerminalHighlight()), m_sessionStack, SIGNAL(removeTerminalHighlight()));
connect(m_tabBar, SIGNAL(tabContextMenuClosed()), m_sessionStack, SIGNAL(removeTerminalHighlight()));
......
......@@ -904,6 +904,7 @@ void TabBar::setTabTitle(int sessionId, const QString& newTitle)
if (!newTitle.isEmpty())
m_tabTitles[sessionId] = newTitle;
emit tabTitleEdited(sessionId, newTitle);
update();
}
......@@ -920,6 +921,7 @@ void TabBar::setTabTitleInteractive(int sessionId, const QString& newTitle)
else
m_tabTitlesSetInteractive.remove(sessionId);
emit tabTitleEdited(sessionId, newTitle);
update();
}
......
......@@ -78,6 +78,7 @@ class TabBar : public QWidget
void requestRemoveTerminalHighlight();
void tabContextMenuClosed();
void lastTabClosed();
void tabTitleEdited(int sessionId, QString title);
protected:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment