From kde-commits Mon May 26 16:06:53 2003 From: Stephan Binner Date: Mon, 26 May 2003 16:06:53 +0000 To: kde-commits Subject: kdebase/konqueror X-MARC-Message: https://marc.info/?l=kde-commits&m=105396522304737 CVS commit by binner: Enabled mouse tab reordering. M +12 -13 konq_tabs.cc 1.4 M +2 -1 konq_tabs.h 1.3 --- kdebase/konqueror/konq_tabs.cc #1.3:1.4 @@ -85,4 +85,7 @@ KonqFrameTabs::KonqFrameTabs(QWidget* pa } #endif + + setTabReorderingEnabled( true ); + connect( this, SIGNAL( movedTab( const int, const int ) ), SLOT( slotMovedTab( const int, const int ) ) ); } @@ -232,11 +235,5 @@ void KonqFrameTabs::moveTabLeft(int inde if ( index == 0 ) return; - KonqFrameBase* currentFrame = m_pChildFrameList->at(index ); - kdDebug()<<" currentFrame :"<widget()); - m_pChildFrameList->remove(currentFrame); - - insertChildFrame( currentFrame, index-1 ); - setCurrentPage( index-1 ); + moveTab( index, index-1 ); } @@ -245,11 +242,13 @@ void KonqFrameTabs::moveTabRight(int ind if ( index == count()-1 ) return; - KonqFrameBase* currentFrame = m_pChildFrameList->at(index ); - kdDebug()<<" currentFrame :"<widget()); - m_pChildFrameList->remove(currentFrame); + moveTab( index, index+1 ); +} - insertChildFrame( currentFrame, index+1 ); - setCurrentPage( index+1 ); +void KonqFrameTabs::slotMovedTab(const int from, const int to) +{ + KonqFrameBase* currentFrame = m_pChildFrameList->at( from ); + kdDebug()<<" currentFrame: "<remove( currentFrame ); + m_pChildFrameList->insert( to, currentFrame ); } --- kdebase/konqueror/konq_tabs.h #1.2:1.3 @@ -97,4 +97,5 @@ private slots: void slotContextMenu( QWidget*, const QPoint& ); void slotCloseRequest( QWidget* ); + void slotMovedTab( const int, const int ); private: