MediaPlayer: Select previous item after item deletion
* Little usability improvement, avoid to select the item each time in case the user want to delete more than one element. * Minor cleanup included.
This commit is contained in:
parent
f022c304b0
commit
663ed1f6a0
@ -722,11 +722,19 @@ DragSortableListView::RemoveSelected()
|
||||
{
|
||||
BList indices;
|
||||
GetSelectedItems(indices);
|
||||
int32 index = CurrentSelection()-1;
|
||||
|
||||
DeselectAll();
|
||||
|
||||
if (indices.CountItems() > 0)
|
||||
RemoveItemList(indices);
|
||||
|
||||
if (CountItems() > 0) {
|
||||
if (index < 0)
|
||||
index = 0;
|
||||
|
||||
Select(index);
|
||||
}
|
||||
}
|
||||
|
||||
// RemoveAll
|
||||
|
@ -240,9 +240,11 @@ PlaylistWindow::MessageReceived(BMessage* message)
|
||||
case M_PLAYLIST_RANDOMIZE:
|
||||
fListView->Randomize();
|
||||
break;
|
||||
|
||||
case M_PLAYLIST_REMOVE:
|
||||
fListView->RemoveSelected();
|
||||
break;
|
||||
|
||||
case M_PLAYLIST_MOVE_TO_TRASH:
|
||||
{
|
||||
int32 index;
|
||||
@ -252,6 +254,7 @@ PlaylistWindow::MessageReceived(BMessage* message)
|
||||
fListView->RemoveSelectionToTrash();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
BWindow::MessageReceived(message);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user