mirror of
https://github.com/KDE/konsole.git
synced 2026-05-19 03:57:43 -04:00
New tab will be placed to the right of the current tab.
This is a improved version, which also works well with split view.
This commit is contained in:
@@ -600,18 +600,27 @@ void ViewManager::createView(Session* session)
|
||||
emit splitViewToggle(false);
|
||||
}
|
||||
|
||||
|
||||
int index = -1;
|
||||
QWidget* activeView = activeView();
|
||||
ViewContainer* activeContainer = _viewSplitter->activeContainer();
|
||||
|
||||
// In all containers the new view will be put at the same position, i.e.,
|
||||
// the position right after the active view in the active container.
|
||||
if (activeView)
|
||||
{
|
||||
QList<QWidget*> views = activeContainer->views();
|
||||
index = views.indexOf(activeView) + 1;
|
||||
}
|
||||
|
||||
// iterate over the view containers owned by this view manager
|
||||
// and create a new terminal display for the session in each of them, along with
|
||||
// a controller for the session/display pair
|
||||
QListIterator<ViewContainer*> containerIter(_viewSplitter->containers());
|
||||
|
||||
while ( containerIter.hasNext() )
|
||||
{
|
||||
ViewContainer* container = containerIter.next();
|
||||
createView(session,container,-1);
|
||||
createView(session, container, index);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ViewContainer* ViewManager::createContainer(const Profile::Ptr info)
|
||||
|
||||
Reference in New Issue
Block a user