2023-09-13 09:12:47 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.15
|
2023-09-26 14:12:33 +00:00
|
|
|
import QtQuick.Shapes 1.5
|
2023-09-13 09:12:47 +00:00
|
|
|
|
2023-10-16 07:27:55 +00:00
|
|
|
import QtGraphicalEffects 1.15
|
|
|
|
|
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
|
2023-09-26 14:12:33 +00:00
|
|
|
property color backgroundColor: Style.current.background
|
|
|
|
property color borderColor: Style.current.border
|
|
|
|
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
|
|
|
|
radius: Style.current.radius * 2
|
|
|
|
leftBottomRadius: root.leftTail ? Style.current.radius / 2 : Style.current.radius * 2
|
|
|
|
rightBottomRadius: root.leftTail ? Style.current.radius * 2 : Style.current.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
|
|
|
|
color: Style.current.dropShadow
|
|
|
|
}
|
2023-09-13 09:12:47 +00:00
|
|
|
}
|
|
|
|
}
|