[vlc-commits] qml: fix the empty behavior of KeyNavigableGridView

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


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

qml: fix the empty behavior of KeyNavigableGridView

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

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

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

diff --git a/modules/gui/qt/qml/utils/KeyNavigableGridView.qml b/modules/gui/qt/qml/utils/KeyNavigableGridView.qml
index 468d13d00e..4b1de3a52e 100644
--- a/modules/gui/qt/qml/utils/KeyNavigableGridView.qml
+++ b/modules/gui/qt/qml/utils/KeyNavigableGridView.qml
@@ -94,7 +94,7 @@ NavigableFocusScope {
                 newIndex = Math.max(0, currentIndex - _colCount * 5)
             }
 
-            if (newIndex != -1 && newIndex != currentIndex) {
+            if (newIndex >= 0 && newIndex < modelCount && newIndex != currentIndex) {
                 var oldIndex = currentIndex
                 currentIndex = newIndex
                 event.accepted = true



More information about the vlc-commits mailing list