This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2022-07-01 17:54:53 +02:00

65 lines
1.6 KiB
QML

import QtQuick 2.3
import QtGraphicalEffects 1.0
import Nymea 1.0
Item {
id: root
property alias backgroundItem: blurEffectSource.sourceItem
property alias backgroundRect: blurEffectSource.sourceRect
Behavior on x { enabled: d.animationsEnabled; NumberAnimation { duration: Style.animationDuration } }
Behavior on y { enabled: d.animationsEnabled; NumberAnimation { duration: Style.animationDuration } }
Behavior on width { enabled: d.animationsEnabled; NumberAnimation { duration: Style.animationDuration } }
Behavior on height { enabled: d.animationsEnabled; NumberAnimation { duration: Style.animationDuration } }
readonly property alias animationsEnabled: d.animationsEnabled
Timer {
running: visible
repeat: false
interval: 1
onTriggered: {
d.animationsEnabled = true
}
}
onVisibleChanged: {
if (!visible) {
d.animationsEnabled = false
}
}
QtObject {
id: d
property bool animationsEnabled: false
}
Rectangle {
id: blurSource
anchors.fill: parent
color: Style.backgroundColor
visible: false
radius: Style.smallCornerRadius
ShaderEffectSource {
id: blurEffectSource
anchors.fill: parent
}
}
FastBlur {
anchors.fill: parent
source: blurSource
radius: 32
visible: root.visible
}
Rectangle {
anchors.fill: parent
color: Style.tooltipBackgroundColor
opacity: .5
radius: Style.smallCornerRadius
}
}