aboutsummaryrefslogtreecommitdiff
path: root/src/Toast.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/Toast.qml')
-rw-r--r--src/Toast.qml13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Toast.qml b/src/Toast.qml
index 60e238c..0de53a9 100644
--- a/src/Toast.qml
+++ b/src/Toast.qml
@@ -36,7 +36,8 @@ import QtQuick.Controls.Material 2.3
*/
/**
- * @brief An Android-like timed message text in a box that self-destroys when finished if desired
+ * @brief An Android-like timed message text in
+ * a box that self-destroys when finished if desired
*/
Control {
@@ -52,16 +53,18 @@ Control {
*/
function show(text, duration) {
message.text = text;
- if (typeof duration !== "undefined") { // checks if parameter was passed
+
+ // checks if parameter was passed
+ if (typeof duration !== "undefined") {
time = Math.max(duration, 2 * fadeTime);
- }
- else {
+ } else {
time = defaultTime;
}
animation.start();
}
- property bool selfDestroying: false // whether this Toast will self-destroy when it is finished
+ // whether this Toast will self-destroy when it is finished
+ property bool selfDestroying: false
/**
* Private