[vlc-commits] qml: fix the empty behaviour of KeyNavigableListView

Adrien Maglo git at videolan.org
Thu Jun 13 13:11:14 CEST 2019


vlc | branch: master | Adrien Maglo <magsoft at videolan.org> | Fri Jun  7 10:57:52 2019 +0200| [e3e3be693598e11b61d83ecfef7acef5b64860bc] | committer: Thomas Guillem

qml: fix the empty behaviour of KeyNavigableListView

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e3e3be693598e11b61d83ecfef7acef5b64860bc
---

 modules/gui/qt/qml/utils/KeyNavigableListView.qml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/qt/qml/utils/KeyNavigableListView.qml b/modules/gui/qt/qml/utils/KeyNavigableListView.qml
index 63aa56d84d..618d50b7c9 100644
--- a/modules/gui/qt/qml/utils/KeyNavigableListView.qml
+++ b/modules/gui/qt/qml/utils/KeyNavigableListView.qml
@@ -137,7 +137,7 @@ NavigableFocusScope {
                 newIndex = Math.max(0, currentIndex - 10)
             }
 
-            if (newIndex != -1) {
+            if (newIndex >= 0 && newIndex < modelCount) {
                 var oldIndex = currentIndex
                 currentIndex = newIndex
                 event.accepted = true



More information about the vlc-commits mailing list