~unity-team/unity8/trunk

« back to all changes in this revision

Viewing changes to qml/Notifications/Notification.qml

  • Committer: Bileto Bot
  • Author(s): Lukáš Tinkl
  • Date: 2016-08-11 06:24:31 UTC
  • mfrom: (2494.1.9 fixDismissedSIMPinDialog)
  • Revision ID: ci-train-bot@canonical.com-20160811062431-993wm6lwdms30qkh
Fix incorrect SIM PIN dialog position when entering a wrong PIN (LP: #1596076)

Approved by: Josh Arenson, Michael Zanetti

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
        name: "Ubuntu.Components.Themes.Ambiance"
56
56
    }
57
57
 
58
 
    signal dismissed()
59
 
 
60
 
    readonly property bool expanded: {
61
 
        var result = false;
62
 
 
63
 
        if (type === Notification.SnapDecision) {
64
 
            if (ListView.view.currentIndex === index || fullscreen) {
65
 
                result = true;
66
 
            } else {
67
 
                if (ListView.view.count > 2) {
68
 
                    if (ListView.view.currentIndex === -1 && index == 1) {
69
 
                        result = true;
70
 
                    } else {
71
 
                        result = false;
72
 
                    }
73
 
                } else {
74
 
                    result = true;
75
 
                }
76
 
            }
77
 
        }
78
 
 
79
 
        return result;
80
 
    }
 
58
    readonly property bool expanded: type === Notification.SnapDecision &&                   // expand only snap decisions, if...
 
59
                                     (fullscreen ||                                          // - it's a fullscreen one
 
60
                                      ListView.view.currentIndex === index ||                // - it's the one the user clicked on
 
61
                                      (ListView.view.currentIndex === -1 && index == 0)      // - the first one after the user closed the previous one
 
62
                                      )
81
63
 
82
64
    NotificationAudio {
83
65
        id: sound
125
107
        notification.notification.invokeAction(notification.actions.data(1, ActionModel.RoleActionId));
126
108
 
127
109
        notification.notification.close();
128
 
        notification.dismissed()
129
110
    }
130
111
 
131
112
    Behavior on x {
142
123
        if (fullscreen) {
143
124
            notification.notification.urgency = Notification.Critical;
144
125
        }
 
126
        ListView.view.topmostIsFullscreen = fullscreen;
145
127
    }
146
128
 
147
 
    Behavior on height {
 
129
    Behavior on implicitHeight {
 
130
        enabled: !fullscreen
148
131
        UbuntuNumberAnimation {
149
132
            duration: UbuntuAnimation.SnapDuration
150
133
        }
217
200
            onNameOwnerChanged: {
218
201
                if (lastNameOwner !== "" && nameOwner === "" && notification.notification !== undefined) {
219
202
                    notification.notification.close()
220
 
                    notification.dismissed()
221
203
                }
222
204
                lastNameOwner = nameOwner
223
205
            }
239
221
                if (notification.type === Notification.Interactive) {
240
222
                    notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
241
223
                } else {
242
 
                    notificationList.currentIndex = index;
 
224
                    notification.ListView.view.currentIndex = index;
243
225
                }
244
226
            }
245
227
            onReleased: {
443
425
                        }
444
426
                        onAccepted: {
445
427
                            notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
446
 
                            notification.dismissed()
447
428
                        }
448
429
                    }
449
430
                }