2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
2023-09-13 09:12:47 +00:00
|
|
|
import QtQuick.Controls 2.15
|
2023-09-26 14:12:33 +00:00
|
|
|
import QtQuick.Shapes 1.5
|
2023-10-16 07:27:55 +00:00
|
|
|
import QtGraphicalEffects 1.15
|
|
|
|
|
2024-10-15 19:26:12 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2023-09-13 09:12:47 +00:00
|
|
|
import utils 1.0
|
|
|
|
import shared 1.0
|
2023-09-26 14:12:33 +00:00
|
|
|
import shared.controls 1.0
|
2023-09-13 09:12:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
Control {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property bool leftTail: true
|
2024-10-15 19:26:12 +00:00
|
|
|
property color backgroundColor: Theme.palette.background
|
|
|
|
property color borderColor: Theme.palette.border
|
2023-09-26 14:12:33 +00:00
|
|
|
property bool dashedBorder: false
|
2023-10-16 07:27:55 +00:00
|
|
|
property bool dropShadow: false
|
2023-09-13 09:12:47 +00:00
|
|
|
property real borderWidth: 1
|
|
|
|
|
|
|
|
readonly property Component clippingEffect: CalloutOpacityMask {
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
|
|
|
leftTail: root.leftTail
|
|
|
|
}
|
|
|
|
|
2023-09-26 14:12:33 +00:00
|
|
|
background: ShapeRectangle {
|
|
|
|
path.fillColor: root.backgroundColor
|
|
|
|
path.strokeColor: root.borderColor
|
|
|
|
path.strokeWidth: root.borderWidth
|
|
|
|
path.strokeStyle: root.dashedBorder ? ShapePath.DashLine : ShapePath.SolidLine
|
2024-10-15 19:26:12 +00:00
|
|
|
radius: Theme.radius * 2
|
|
|
|
leftBottomRadius: root.leftTail ? Theme.radius / 2 : Theme.radius * 2
|
|
|
|
rightBottomRadius: root.leftTail ? Theme.radius * 2 : Theme.radius / 2
|
2023-10-16 07:27:55 +00:00
|
|
|
layer.enabled: root.dropShadow
|
|
|
|
layer.effect: DropShadow {
|
|
|
|
verticalOffset: 3
|
|
|
|
radius: 8
|
|
|
|
samples: 15
|
|
|
|
fast: true
|
|
|
|
cached: true
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.dropShadow
|
2023-10-16 07:27:55 +00:00
|
|
|
}
|
2023-09-13 09:12:47 +00:00
|
|
|
}
|
|
|
|
}
|