on xenial help sign in
cleanup focus
commitff23a1c5958338456ea9211d04c6dbb12f35265a authorNick Dedekind <nick.dedekind@canonical.com> dateFri 1 May 2015, 15:09 (11 years ago) parent6d13c4d
3 files changed+12−6
qml/Stages/DesktopStage.qml+4−2 qml/Stages/PhoneStage.qml+4−2 qml/Stages/TabletStage.qml+4−2
qml/Stages/DesktopStage.qml+4−2
@@ -55,8 +55,10 @@ Rectangle {
5555 id: priv
5656
5757 readonly property string focusedAppId: ApplicationManager.focusedApplicationId
58− readonly property int focusedAppIndex: indexOf(focusedAppId)
59− readonly property var focusedAppDelegate: focusedAppId && appRepeater.count > focusedAppIndex ? appRepeater.itemAt(focusedAppIndex) : null
58+ readonly property var focusedAppDelegate: {
59+ var index = indexOf(focusedAppId);
60+ return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
61+ }
6062
6163 onFocusedAppDelegateChanged: {
6264 if (focusedAppDelegate) {
qml/Stages/PhoneStage.qml+4−2
@@ -117,8 +117,10 @@ Rectangle {
117117
118118 readonly property int firstSpreadIndex: root.focusFirstApp ? 1 : 0
119119 property string focusedAppId: applicationManager.focusedApplicationId
120− readonly property int focusedAppIndex: indexOf(focusedAppId)
121− readonly property var focusedAppDelegate: focusedAppId && spreadRepeater.count > focusedAppIndex ? spreadRepeater.itemAt(focusedAppIndex) : null
120+ readonly property var focusedAppDelegate: {
121+ var index = indexOf(focusedAppId);
122+ return index >= 0 && index < spreadRepeater.count ? spreadRepeater.itemAt(index) : null
123+ }
122124
123125 property real oldInverseProgress: 0
124126 property bool animateX: false
qml/Stages/TabletStage.qml+4−2
@@ -53,8 +53,10 @@ Rectangle {
5353 id: priv
5454
5555 property string focusedAppId: ApplicationManager.focusedApplicationId
56− readonly property int focusedAppIndex: indexOf(focusedAppId)
57− readonly property var focusedAppDelegate: focusedAppId && spreadRepeater.count > focusedAppIndex ? spreadRepeater.itemAt(focusedAppIndex) : null
56+ readonly property var focusedAppDelegate: {
57+ var index = indexOf(focusedAppId);
58+ return index >= 0 && index < spreadRepeater.count ? spreadRepeater.itemAt(index) : null
59+ }
5860
5961 property string oldFocusedAppId: ""
6062