From 5755ad47145d2985ba74354961b4127d82c516f6 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 5 Apr 2017 13:00:21 +0200 Subject: A single framework plugin --- framework/qml/Notification.qml | 83 ------------------------------------------ 1 file changed, 83 deletions(-) delete mode 100644 framework/qml/Notification.qml (limited to 'framework/qml/Notification.qml') diff --git a/framework/qml/Notification.qml b/framework/qml/Notification.qml deleted file mode 100644 index 15291c43..00000000 --- a/framework/qml/Notification.qml +++ /dev/null @@ -1,83 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.0 - -import org.kde.kirigami 1.0 as Kirigami -import org.kube.components.theme 1.0 as KubeTheme - - -MouseArea { - id: popup - - property alias title: message.text - property alias timeout: hideTimer.interval - property alias background: bg.color - - function hide() { - if (hideTimer.running) - hideTimer.stop() - popup.opacity = 0.0 - } - - function show() { - console.warn("Trying to show the notification", title); - popup.opacity = 1.0 - hideTimer.restart() - } - - function notify(text) { - popup.title = text - bg.color = KubeTheme.Colors.textColor - show() - } - - Timer { - id: hideTimer - triggeredOnStart: false - repeat: false - interval: 5000 - onTriggered: popup.hide() - } - - width: Math.max(300, message.contentWidth + (Kirigami.Units.largeSpacing * 2)) - height: Math.max(50, message.contentHeight + (Kirigami.Units.largeSpacing * 2)) - - visible: opacity > 0 - opacity: 0.0 - - Behavior on opacity { - NumberAnimation { - duration: 200 - easing.type: Easing.InOutQuad - property: "opacity" - } - } - - Rectangle { - id: bg - - anchors.fill: parent - - opacity: 0.6 - } - - Label { - id: message - - anchors { - verticalCenter: popup.verticalCenter - left: parent.left - leftMargin: Kirigami.Units.largeSpacing - right: parent.right - rightMargin: Kirigami.Units.largeSpacing - } - - font.pixelSize: 16 - - color: KubeTheme.Colors.highlightedTextColor - horizontalAlignment: Text.AlignHCenter - elide: Text.ElideRight - wrapMode: Text.Wrap - } - - onClicked: hide() -} -- cgit v1.2.3