on xenial help sign in
Prevent overlapping animations
afe6f55Michael Terry
Greeter/GreeterContent.qml+6−7
@@ -141,20 +141,19 @@ MouseArea {
141
141
142 property string selectedUser
142 property string selectedUser
143 property string infographicUser: AccountsService.statsWelcomeScreen ? selectedUser : ""
143 property string infographicUser: AccountsService.statsWelcomeScreen ? selectedUser : ""
144− onInfographicUserChanged: updateUsername()
144+ onInfographicUserChanged: greeterContentLoader.infographicModel.username = infographicUser
145
145
146+ Component.onCompleted: {
146− Component.onCompleted: selectedUser = greeterContentLoader.model.data(greeterContentLoader.currentIndex, LightDM.UserRoles.NameRole)
147+ selectedUser = greeterContentLoader.model.data(greeterContentLoader.currentIndex, LightDM.UserRoles.NameRole)
148+ greeterContentLoader.infographicModel.username = infographicUser
149+ greeterContentLoader.infographicModel.readyForDataChangeSlot()
150+ }
147
151
148 Connections {
152 Connections {
149 target: root
153 target: root
150 onSelected: infographics.selectedUser = greeterContentLoader.model.data(uid, LightDM.UserRoles.NameRole)
154 onSelected: infographics.selectedUser = greeterContentLoader.model.data(uid, LightDM.UserRoles.NameRole)
151 }
155 }
152
156
153− function updateUsername() {
154− greeterContentLoader.infographicModel.username = infographicUser;
155− greeterContentLoader.infographicModel.readyForDataChangeSlot();
156− }
157−
158 anchors {
157 anchors {
159 verticalCenter: parent.verticalCenter
158 verticalCenter: parent.verticalCenter
160 left: narrowMode ? root.left : loginLoader.right
159 left: narrowMode ? root.left : loginLoader.right
Greeter/Infographics.qml+9−7
@@ -29,13 +29,7 @@ Item {
29 Connections {
29 Connections {
30 target: model
30 target: model
31
31
32− property bool appeared: false
33−
34− onDataAboutToAppear: {
35− // Don't 'hide' on first appearance, since there is no content yet
36− if (appeared) startHideAnimation() // hide "no data" label
32+ onDataAboutToAppear: startHideAnimation() // hide "no data" label
37− appeared = true
38− }
39 onDataAppeared: startShowAnimation()
33 onDataAppeared: startShowAnimation()
40
34
41 onDataAboutToChange: startHideAnimation()
35 onDataAboutToChange: startHideAnimation()
@@ -46,11 +40,19 @@ Item {
46 }
40 }
47
41
48 function startShowAnimation() {
42 function startShowAnimation() {
43+ dotHideAnimTimer.stop()
44+ circleShrinkAnimTimer.stop()
45+ notification.hideAnim.stop()
46+
49 dotShowAnimTimer.startFromBeginning()
47 dotShowAnimTimer.startFromBeginning()
50 notification.showAnim.start()
48 notification.showAnim.start()
51 }
49 }
52
50
53 function startHideAnimation() {
51 function startHideAnimation() {
52+ dotShowAnimTimer.stop()
53+ circleGrowAnimTimer.stop()
54+ notification.showAnim.stop()
55+
54 dotHideAnimTimer.startFromBeginning()
56 dotHideAnimTimer.startFromBeginning()
55 notification.hideAnim.start()
57 notification.hideAnim.start()
56 }
58 }