vlc | branch: master | Ludovic Fauvet <[email protected]> | Fri Sep 24 00:04:50 2010 +0200| [5b86425b762dab1f6b5bc3e0d6776188c8d927af] | committer: Jean-Baptiste Kempf
qt4: attempt to work around a design flaw in the toolbar editor Signed-off-by: Jean-Baptiste Kempf <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5b86425b762dab1f6b5bc3e0d6776188c8d927af --- modules/gui/qt4/dialogs/toolbar.cpp | 7 +++++++ modules/gui/qt4/dialogs/toolbar.hpp | 1 + 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/modules/gui/qt4/dialogs/toolbar.cpp b/modules/gui/qt4/dialogs/toolbar.cpp index 17ec24d..72cf407 100644 --- a/modules/gui/qt4/dialogs/toolbar.cpp +++ b/modules/gui/qt4/dialogs/toolbar.cpp @@ -672,6 +672,11 @@ void DroppingController::dropEvent( QDropEvent *event ) { int i = getParentPosInLayout( event->pos() ); + /* Workaround: do not let the item move to its current + position + 1 as it breaks the widgetList */ + if ( i - 1 == i_dragIndex ) + --i; + QByteArray data = event->mimeData()->data( "vlc/button-bar" ); QDataStream dataStream(&data, QIODevice::ReadOnly); @@ -727,6 +732,8 @@ bool DroppingController::eventFilter( QObject *obj, QEvent *event ) } if( i == -1 ) return true; + i_dragIndex = i; + doubleInt *dI = widgetList.at( i ); int i_type = dI->i_type; diff --git a/modules/gui/qt4/dialogs/toolbar.hpp b/modules/gui/qt4/dialogs/toolbar.hpp index 6a436d8..52f4241 100644 --- a/modules/gui/qt4/dialogs/toolbar.hpp +++ b/modules/gui/qt4/dialogs/toolbar.hpp @@ -112,6 +112,7 @@ private: }; QRubberBand *rubberband; QList <doubleInt *> widgetList; + int i_dragIndex; int getParentPosInLayout( QPoint point); _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
