qml: add option to jump to playing in Playlist

This commit is contained in:
Prince Gupta 2024-03-14 11:57:25 +05:30 committed by Jean-Baptiste Kempf
parent 69a449868d
commit 4cd7e93525
3 changed files with 11 additions and 0 deletions

View File

@ -874,6 +874,12 @@ void PlaylistContextMenu::popup(int selectedIndex, QPoint pos )
m_menu->addSeparator();
}
if (m_controler->currentIndex() != -1)
{
action = m_menu->addAction( qtr("Jump to current playing"));
connect(action, &QAction::triggered, this, &PlaylistContextMenu::jumpToCurrentPlaying);
}
if (m_selectionModel->hasSelection()) {
action = m_menu->addAction( qtr("Stream") );
connect(action, &QAction::triggered, [selectedUrlList]( ) {

View File

@ -378,6 +378,9 @@ class PlaylistContextMenu : public QObject {
public:
PlaylistContextMenu(QObject* parent = nullptr);
signals:
void jumpToCurrentPlaying();
public slots:
void popup(int currentIndex, QPoint pos );
private:

View File

@ -137,6 +137,8 @@ T.Pane {
model: root.model
selectionModel: root.selectionModel
controler: MainPlaylistController
onJumpToCurrentPlaying: listView.positionViewAtIndex( MainPlaylistController.currentIndex, ItemView.Center)
}
background: Widgets.AcrylicBackground {