moment/harmonyqml/components/base/HGlassRectangle.qml

39 lines
997 B
QML
Raw Normal View History

2019-04-28 14:44:55 +10:00
import QtQuick 2.7
import QtGraphicalEffects 1.0
Item {
2019-04-29 01:01:38 +10:00
property bool isPageStackDescendant: true
2019-04-28 14:44:55 +10:00
default property alias children: rectangle.children
property alias color: rectangle.color
property alias gradient: rectangle.gradient
property alias blurRadius: fastBlur.radius
property alias border: rectangle.border
property alias radius: rectangle.radius
ShaderEffectSource {
id: effectSource
sourceItem: mainUIBackground
anchors.fill: parent
sourceRect: Qt.rect(
2019-04-29 01:01:38 +10:00
(isPageStackDescendant ? pageStack.x : 0) + parent.x,
(isPageStackDescendant ? pageStack.y : 0) + parent.y,
width,
height
2019-04-28 14:44:55 +10:00
)
}
FastBlur {
id: fastBlur
anchors.fill: effectSource
source: effectSource
2019-04-29 01:01:38 +10:00
radius: rectangle.color == "#00000000" ? 0 : 8
2019-04-28 14:44:55 +10:00
}
Rectangle {
id: rectangle
anchors.fill: parent
color: HStyle.sidePane.background
}
}