Commit d4fdf4bb authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: correct right click selection.

That way, when you right-click on the not-selected item, you can delete it.
(cherry picked from commit df20afd7)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 8b9d73a7
......@@ -67,6 +67,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
view->setIconSize( QSize( 20, 20 ) );
view->setAlternatingRowColors( true );
view->setAnimated( true );
view->setSelectionBehavior( QAbstractItemView::SelectRows );
view->setSelectionMode( QAbstractItemView::ExtendedSelection );
view->setDragEnabled( true );
view->setAcceptDrops( true );
......@@ -240,7 +241,10 @@ void StandardPLPanel::popupAdd()
if( currentRootId == THEPL->p_local_category->i_id ||
currentRootId == THEPL->p_local_onelevel->i_id )
{
popup.addAction( qtr(I_PL_ADDF), THEDP, SLOT(PLAppendDialog()) );
popup.addAction( qtr(I_PL_ADDF), THEDP, SLOT(PLAppendDialog( OPEN_FILE_TAB )) );
popup.addAction( qtr(I_PL_ADDF), THEDP, SLOT(PLAppendDialog( OPEN_DISC_TAB )) );
popup.addAction( qtr(I_PL_ADDF), THEDP, SLOT(PLAppendDialog( OPEN_NETWORK_TAB )) );
popup.addAction( qtr(I_PL_ADDF), THEDP, SLOT(PLAppendDialog( OPEN_FILE_TAB )) );
popup.addAction( qtr(I_PL_ADDDIR), THEDP, SLOT( PLAppendDir()) );
}
else if( ( THEPL->p_ml_category &&
......
......@@ -101,8 +101,10 @@ public:
{
if( e->button() & Qt::RightButton )
{
emit rightClicked( indexAt( QPoint( e->x(), e->y() ) ),
QCursor::pos() );
QModelIndex index = indexAt( QPoint( e->x(), e->y() ) );
if( index.isValid() )
setSelection( visualRect( index ), QItemSelectionModel::ClearAndSelect );
emit rightClicked( index, QCursor::pos() );
return;
}
if( e->button() & Qt::LeftButton )
......
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