on xenial help sign in
cleanup focus
ff23a1cNick Dedekind
qml/Stages/DesktopStage.qml+4−2
@@ -55,8 +55,10 @@ Rectangle {
55 id: priv
55 id: priv
56
56
57 readonly property string focusedAppId: ApplicationManager.focusedApplicationId
57 readonly property string focusedAppId: ApplicationManager.focusedApplicationId
58− readonly property int focusedAppIndex: indexOf(focusedAppId)
58+ readonly property var focusedAppDelegate: {
59+ var index = indexOf(focusedAppId);
59− readonly property var focusedAppDelegate: focusedAppId && appRepeater.count > focusedAppIndex ? appRepeater.itemAt(focusedAppIndex) : null
60+ return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
61+ }
60
62
61 onFocusedAppDelegateChanged: {
63 onFocusedAppDelegateChanged: {
62 if (focusedAppDelegate) {
64 if (focusedAppDelegate) {
qml/Stages/PhoneStage.qml+4−2
@@ -117,8 +117,10 @@ Rectangle {
117
117
118 readonly property int firstSpreadIndex: root.focusFirstApp ? 1 : 0
118 readonly property int firstSpreadIndex: root.focusFirstApp ? 1 : 0
119 property string focusedAppId: applicationManager.focusedApplicationId
119 property string focusedAppId: applicationManager.focusedApplicationId
120− readonly property int focusedAppIndex: indexOf(focusedAppId)
120+ readonly property var focusedAppDelegate: {
121+ var index = indexOf(focusedAppId);
121− readonly property var focusedAppDelegate: focusedAppId && spreadRepeater.count > focusedAppIndex ? spreadRepeater.itemAt(focusedAppIndex) : null
122+ return index >= 0 && index < spreadRepeater.count ? spreadRepeater.itemAt(index) : null
123+ }
122
124
123 property real oldInverseProgress: 0
125 property real oldInverseProgress: 0
124 property bool animateX: false
126 property bool animateX: false
qml/Stages/TabletStage.qml+4−2
@@ -53,8 +53,10 @@ Rectangle {
53 id: priv
53 id: priv
54
54
55 property string focusedAppId: ApplicationManager.focusedApplicationId
55 property string focusedAppId: ApplicationManager.focusedApplicationId
56− readonly property int focusedAppIndex: indexOf(focusedAppId)
56+ readonly property var focusedAppDelegate: {
57+ var index = indexOf(focusedAppId);
57− readonly property var focusedAppDelegate: focusedAppId && spreadRepeater.count > focusedAppIndex ? spreadRepeater.itemAt(focusedAppIndex) : null
58+ return index >= 0 && index < spreadRepeater.count ? spreadRepeater.itemAt(index) : null
59+ }
58
60
59 property string oldFocusedAppId: ""
61 property string oldFocusedAppId: ""
60
62