mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-27 11:40:07 +00:00
Make tabs rearrangeable
BUGS: 334018 FIXED-IN: 4.14.0 REVIEW: 118685
This commit is contained in:
parent
d30861fb1a
commit
375c72dc66
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue