X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fdialogs%2Ftoolbar.cpp;h=72cf40776d95eb5474e25412a1159e55be9aacc1;hb=5b86425b762dab1f6b5bc3e0d6776188c8d927af;hp=0f6702547757aca3d301d95fac29ead7dcf09c44;hpb=4732f9dbb7b107bd87a15fe1250afe9c033b3a12;p=vlc diff --git a/modules/gui/qt4/dialogs/toolbar.cpp b/modules/gui/qt4/dialogs/toolbar.cpp index 0f67025477..72cf40776d 100644 --- a/modules/gui/qt4/dialogs/toolbar.cpp +++ b/modules/gui/qt4/dialogs/toolbar.cpp @@ -36,11 +36,14 @@ #include #include #include +#include #include #include #include +#include + ToolbarEditDialog::ToolbarEditDialog( QWidget *_w, intf_thread_t *_p_intf) : QVLCDialog( _w, _p_intf ) { @@ -83,7 +86,7 @@ ToolbarEditDialog::ToolbarEditDialog( QWidget *_w, intf_thread_t *_p_intf) getSettings()->value( "MainWindow/ToolbarPos", 0 ).toInt() ) ); mainTboxLayout->addWidget( positionCombo, 0, 2, 1, 1 ); - QLabel *line1Label = new QLabel( "Line 1:" ); + QLabel *line1Label = new QLabel( qtr("Line 1:") ); QString line1 = getSettings()->value( "MainWindow/MainToolbar1", MAIN_TB1_DEFAULT ).toString(); controller1 = new DroppingController( p_intf, line1, @@ -91,7 +94,7 @@ ToolbarEditDialog::ToolbarEditDialog( QWidget *_w, intf_thread_t *_p_intf) mainTboxLayout->addWidget( line1Label, 1, 0, 1, 1 ); mainTboxLayout->addWidget( controller1, 1, 1, 1, 2 ); - QLabel *line2Label = new QLabel( "Line 2:" ); + QLabel *line2Label = new QLabel( qtr("Line 2:") ); QString line2 = getSettings()->value( "MainWindow/MainToolbar2", MAIN_TB2_DEFAULT ).toString(); controller2 = new DroppingController( p_intf, line2, @@ -669,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); @@ -724,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;