This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-Qt/doric/resources/vlayout.qml

75 lines
1.5 KiB
QML
Raw Normal View History

2021-02-23 14:28:08 +08:00
import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.15
import QtGraphicalEffects 1.12
2021-02-23 14:28:08 +08:00
import "util.mjs" as Util
Rectangle {
2021-04-07 10:41:34 +08:00
property var wrapper
2021-04-06 17:07:48 +08:00
clip: true
property var uuid: Util.uuidv4()
2021-04-13 21:14:17 +08:00
property var tag: "VLayout"
2021-04-07 10:41:34 +08:00
onWidthChanged: {
console.log(tag, uuid + " onWidthChanged: " + this.width)
}
2021-04-07 10:41:34 +08:00
onHeightChanged: {
console.log(tag, uuid + " onHeightChanged: " + this.height)
}
color: 'transparent'
property var backgroundColor
onBackgroundColorChanged: {
color = backgroundColor
}
property var borderWidth: 0
onBorderWidthChanged: {
border.width = borderWidth
}
property var borderColor: ""
onBorderColorChanged: {
border.color = borderColor
}
MouseArea {
anchors.fill: parent
onClicked: {
2021-04-07 10:41:34 +08:00
console.log(tag, uuid + " wrapper: " + wrapper)
mouseAreaBridge.onClick(wrapper)
}
}
property var shadowColor
property var shadowRadius
property var shadowOffsetX
property var shadowOffsetY
property var shadowOpacity
onShadowOpacityChanged: {
if (shadowOpacity > 0) {
layer.enabled = true
} else {
layer.enabled = false
}
}
layer.enabled: false
layer.effect: DropShadow {
horizontalOffset: shadowOffsetX
verticalOffset: shadowOffsetY
radius: shadowRadius
samples: 16
color: shadowColor
transparentBorder: true
}
}