mirror of https://code.videolan.org/videolan/vlc
qml: add option to jump to playing in Playlist
This commit is contained in:
parent
69a449868d
commit
4cd7e93525
|
@ -874,6 +874,12 @@ void PlaylistContextMenu::popup(int selectedIndex, QPoint pos )
|
||||||
m_menu->addSeparator();
|
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()) {
|
if (m_selectionModel->hasSelection()) {
|
||||||
action = m_menu->addAction( qtr("Stream") );
|
action = m_menu->addAction( qtr("Stream") );
|
||||||
connect(action, &QAction::triggered, [selectedUrlList]( ) {
|
connect(action, &QAction::triggered, [selectedUrlList]( ) {
|
||||||
|
|
|
@ -378,6 +378,9 @@ class PlaylistContextMenu : public QObject {
|
||||||
public:
|
public:
|
||||||
PlaylistContextMenu(QObject* parent = nullptr);
|
PlaylistContextMenu(QObject* parent = nullptr);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void jumpToCurrentPlaying();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void popup(int currentIndex, QPoint pos );
|
void popup(int currentIndex, QPoint pos );
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -137,6 +137,8 @@ T.Pane {
|
||||||
model: root.model
|
model: root.model
|
||||||
selectionModel: root.selectionModel
|
selectionModel: root.selectionModel
|
||||||
controler: MainPlaylistController
|
controler: MainPlaylistController
|
||||||
|
|
||||||
|
onJumpToCurrentPlaying: listView.positionViewAtIndex( MainPlaylistController.currentIndex, ItemView.Center)
|
||||||
}
|
}
|
||||||
|
|
||||||
background: Widgets.AcrylicBackground {
|
background: Widgets.AcrylicBackground {
|
||||||
|
|
Loading…
Reference in New Issue