Skip to content
Snippets Groups Projects
Commit cf545379 authored by Yann Lochet's avatar Yann Lochet Committed by Steve Lhomme
Browse files

qml/MusicArtistsAlbums: fix keyboard navigation in small layout

When entering MusicArtistsAlbums in small layout the focus was not set
on MusicArtist
parent 6a742c90
No related branches found
No related tags found
1 merge request!3148qml/MusicArtistsAlbums: fix keyboard navigation in small layout
Pipeline #308449 passed with stage
in 27 minutes and 58 seconds
......@@ -205,6 +205,10 @@ FocusScope {
}
function setCurrentItemFocus(reason) {
if (view.currentItem === null) {
Qt.callLater(setCurrentItemFocus, reason)
return
}
view.currentItem.setCurrentItemFocus(reason);
}
......
......@@ -53,12 +53,22 @@ FocusScope {
property alias currentAlbumIndex: albumSubView.currentIndex
property alias currentArtist: albumSubView.artist
property bool isScreenSmall: VLCStyle.isScreenSmall
onInitialAlbumIndexChanged: resetFocus()
onInitialIndexChanged: resetFocus()
onCurrentIndexChanged: currentArtist = model.getDataAt(currentIndex)
onIsScreenSmallChanged: {
if (VLCStyle.isScreenSmall)
resetFocus()
}
function resetFocus() {
if (VLCStyle.isScreenSmall) {
albumSubView.setCurrentItemFocus(Qt.OtherFocusReason)
return
}
if (artistModel.count === 0) {
return
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment