vlc | branch: master | Pierre Lamot <[email protected]> | Fri Jul 26 18:44:40 2019 +0200| [1169b7436686ff7f19f8a4e2f0befe1fef085863] | committer: Jean-Baptiste Kempf
qml: set the focus on the first element by default in PlaylistListView > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1169b7436686ff7f19f8a4e2f0befe1fef085863 --- modules/gui/qt/qml/playlist/PlaylistListView.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/gui/qt/qml/playlist/PlaylistListView.qml b/modules/gui/qt/qml/playlist/PlaylistListView.qml index c60220aada..ae34af5e5b 100644 --- a/modules/gui/qt/qml/playlist/PlaylistListView.qml +++ b/modules/gui/qt/qml/playlist/PlaylistListView.qml @@ -73,6 +73,18 @@ Utils.NavigableFocusScope { property int shiftIndex: -1 property string mode: "normal" + Connections { + target: root.plmodel + onRowsInserted: { + if (view.currentIndex == -1) + view.currentIndex = 0 + } + onModelReset: { + if (view.currentIndex == -1 && root.plmodel.count > 0) + view.currentIndex = 0 + } + } + footer: PLItemFooter {} delegate: PLItem { _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
