/
NeoChapay
/
telegraf
Обзор
Документация
Войти
/
NeoChapay
/
telegraf
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
qml/components/AppNotification.qml
56 строк
1 KB
mbarashkov
Существенно улучшена и исправлена пересылка сообщений
21 дек 2024, 18:11
21 дек 2024, 18:11
413ecec
Код
Авторство
О чём код?
import QtQuick 2.6 import Sailfish.Silica 1.0 Item { id: notificationItem z: 42 y: -100 Behavior on y { PropertyAnimation { easing.type: Easing.OutCubic } } anchors.horizontalCenter: parent.horizontalCenter width: parent.width - 2 * Theme.horizontalPageMargin function show(message, additionalInformation) { notificationTextItem.text = message; if (additionalInformation) { notificationTextItem.additionalInformation = additionalInformation; } notificationTimer.start(); notificationTextItem.visible = true; notificationTextItem.opacity = 1; notificationItem.y = notificationItem.parent.height / 2; } Connections { target: notificationTimer onTriggered: { notificationItem.y = notificationItem.parent.height + 100; notificationTextItem.opacity = 0; notificationResetter.start(); } } Connections { target: notificationResetter onTriggered: { notificationTextItem.visible = false; notificationItem.y = -100 } } Timer { id: notificationTimer repeat: false interval: 3500 } Timer { id: notificationResetter repeat: false interval: 2000 } AppNotificationItem { id: notificationTextItem } }