diff options
author | Jan Holthuis <jholthuis@mixxx.org> | 2022-01-05 14:13:11 +0100 |
---|---|---|
committer | Jan Holthuis <jholthuis@mixxx.org> | 2022-01-11 19:53:42 +0100 |
commit | 3df180dffc0450262521e842cbe09b3a1b7e9dd3 (patch) | |
tree | fa35354a26d994d836cd08555c82eb9b56da605f | |
parent | 62158fc19923e71a320668102265232da67f759d (diff) |
QML: Improve library focus handling
-rw-r--r-- | res/qml/Library.qml | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/res/qml/Library.qml b/res/qml/Library.qml index d6589927ef..109ae529f7 100644 --- a/res/qml/Library.qml +++ b/res/qml/Library.qml @@ -15,6 +15,13 @@ Item { onMoveSelection: listView.moveSelection(offset) onLoadSelectedTrack: listView.loadSelectedTrack(group, play) onLoadSelectedTrackIntoNextAvailableDeck: listView.loadSelectedTrackIntoNextAvailableDeck(play) + onFocusWidgetChanged: { + switch (focusWidget) { + case FocusedWidgetControl.WidgetKind.LibraryView: + listView.forceActiveFocus(); + break; + } + } } ListView { @@ -54,7 +61,6 @@ Item { anchors.fill: parent anchors.margins: 10 clip: true - focus: true highlightMoveDuration: 250 highlightResizeDuration: 50 model: Mixxx.Library.model @@ -68,7 +74,7 @@ Item { Text { anchors.verticalCenter: parent.verticalCenter text: artist + " - " + title - color: listView.currentIndex == index ? Theme.blue : Theme.deckTextColor + color: (listView.currentIndex == index && listView.activeFocus) ? Theme.blue : Theme.deckTextColor Behavior on color { ColorAnimation { @@ -98,6 +104,7 @@ Item { anchors.fill: parent drag.target: dragItem onPressed: { + listView.forceActiveFocus(); listView.currentIndex = index; parent.grabToImage((result) => { dragItem.Drag.imageSource = result.url; @@ -108,7 +115,7 @@ Item { } highlight: Rectangle { - border.color: Theme.blue + border.color: listView.activeFocus ? Theme.blue : Theme.deckTextColor border.width: 1 color: "transparent" } |