Changeset View
Changeset View
Standalone View
Standalone View
src/controls/templates/private/PassiveNotification.qml
Show All 38 Lines | 26 | MouseArea { | |||
---|---|---|---|---|---|
39 | function showNotification(message, timeout, actionText, callBack) { | 39 | function showNotification(message, timeout, actionText, callBack) { | ||
40 | if (!message) { | 40 | if (!message) { | ||
41 | return; | 41 | return; | ||
42 | } | 42 | } | ||
43 | appearAnimation.running = false; | 43 | appearAnimation.running = false; | ||
44 | appearAnimation.appear = true; | 44 | appearAnimation.appear = true; | ||
45 | appearAnimation.running = true; | 45 | appearAnimation.running = true; | ||
46 | if (timeout == "short") { | 46 | if (timeout == "short") { | ||
47 | timer.interval = 1000; | 47 | timer.interval = 4000; | ||
ngraham: Not sure there was possibly a use case for a one-second textual notification. With this patch… | |||||
48 | } else if (timeout == "long") { | 48 | } else if (timeout == "long") { | ||
49 | timer.interval = 4500; | 49 | timer.interval = 12000; | ||
50 | } else if (timeout > 0) { | 50 | } else if (timeout > 0) { | ||
51 | timer.interval = timeout; | 51 | timer.interval = timeout; | ||
52 | } else { | 52 | } else { | ||
53 | timer.interval = 4500; | 53 | timer.interval = 7000; | ||
54 | } | 54 | } | ||
55 | messageLabel.text = message ? message : ""; | 55 | messageLabel.text = message ? message : ""; | ||
56 | actionButton.text = actionText ? actionText : ""; | 56 | actionButton.text = actionText ? actionText : ""; | ||
57 | actionButton.callBack = callBack ? callBack : ""; | 57 | actionButton.callBack = callBack ? callBack : ""; | ||
58 | 58 | | |||
59 | timer.restart(); | 59 | timer.restart(); | ||
60 | } | 60 | } | ||
61 | 61 | | |||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |
Not sure there was possibly a use case for a one-second textual notification. With this patch, the short duration is actually useful for very short messages.