Commit 375c72dc authored by Jonathan Doman's avatar Jonathan Doman Committed by Albert Astals Cid

Make tabs rearrangeable

BUGS: 334018
FIXED-IN: 4.14.0
REVIEW: 118685
parent d30861fb
......@@ -46,6 +46,7 @@
#include <ktabwidget.h>
#include <kxmlguifactory.h>
#include <QDragMoveEvent>
#include <QTabBar>
#ifdef KActivities_FOUND
#include <KActivities/ResourceInstance>
......@@ -103,10 +104,12 @@ void Shell::init()
m_tabWidget->setElideMode( Qt::ElideRight );
m_tabWidget->setTabBarHidden( true );
m_tabWidget->setDocumentMode( true );
m_tabWidget->setMovable( true );
connect( m_tabWidget, SIGNAL(currentChanged(int)), SLOT(setActiveTab(int)) );
connect( m_tabWidget, SIGNAL(tabCloseRequested(int)), SLOT(closeTab(int)) );
connect( m_tabWidget, SIGNAL(testCanDecode(const QDragMoveEvent*,bool&)), SLOT(testTabDrop(const QDragMoveEvent*,bool&)) );
connect( m_tabWidget, SIGNAL(receivedDropEvent(QDropEvent*)), SLOT(handleTabDrop(QDropEvent*)) );
connect( m_tabWidget->tabBar(), SIGNAL(tabMoved(int,int)), SLOT(moveTabData(int,int)) );
setCentralWidget( m_tabWidget );
......@@ -645,6 +648,11 @@ void Shell::handleTabDrop( QDropEvent* event )
handleDroppedUrls( list );
}
void Shell::moveTabData( int from, int to )
{
m_tabs.move( from, to );
}
#include "shell.moc"
/* kate: replace-tabs on; indent-width 4; */
......@@ -109,6 +109,7 @@ private slots:
void activatePrevTab();
void testTabDrop( const QDragMoveEvent* event, bool& accept );
void handleTabDrop( QDropEvent* event );
void moveTabData( int from, int to );
signals:
void restoreDocument(const KConfigGroup &group);
......
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