From 85024d0f75d19bcb17ea0f3dd9f4aee786332297 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 2 Jul 2018 14:31:05 +0100 Subject: [PATCH] Improve aircraft list hightling When selecting an aircraft programtically, don't animate the move --- src/GUI/qml/AircraftList.qml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/GUI/qml/AircraftList.qml b/src/GUI/qml/AircraftList.qml index eb21df776..05ca3557a 100644 --- a/src/GUI/qml/AircraftList.qml +++ b/src/GUI/qml/AircraftList.qml @@ -142,7 +142,11 @@ Item enabled: !detailsView.visible highlight: highlight - highlightMoveDuration: 100 + highlightMoveDuration: __realHighlightMoveDuration + + // saved here becuase we need to reset highlightMoveDuration + // when doing a progrmatic set + readonly property int __realHighlightMoveDuration: 200 Keys.onUpPressed: { @@ -157,7 +161,11 @@ Item model.selectVariantForAircraftURI(_launcher.selectedAircraft); var row = model.indexForURI(_launcher.selectedAircraft); if (row >= 0) { + // sequence here is necessary so progrommatic moves + // are instant + highlightMoveDuration = 0; currentIndex = row; + highlightMoveDuration = __realHighlightMoveDuration; } else { // clear selection in view, so we don't show something // erroneous such as the previous value