Lukáš Tinkl d9d6d90dc9 [Style] remove legacy Style and its themes
- legacy Style and ThemePalette removed
- moved and deduplicated font definitions into `Theme` (unrelated to a
color palette)
- `Style.current.foo` -> `Theme.foo`
- `Style.current.fooColor` -> `Theme.palette.fooColor`
- upgrade the imports to 5.15
- removed some mode dead components

Fixes #16514
2024-10-22 15:54:31 +02:00

48 lines
1.3 KiB
QML

import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Shapes 1.5
import QtGraphicalEffects 1.15
import StatusQ.Core.Theme 0.1
import utils 1.0
import shared 1.0
import shared.controls 1.0
Control {
id: root
property bool leftTail: true
property color backgroundColor: Theme.palette.background
property color borderColor: Theme.palette.border
property bool dashedBorder: false
property bool dropShadow: false
property real borderWidth: 1
readonly property Component clippingEffect: CalloutOpacityMask {
width: parent.width
height: parent.height
leftTail: root.leftTail
}
background: ShapeRectangle {
path.fillColor: root.backgroundColor
path.strokeColor: root.borderColor
path.strokeWidth: root.borderWidth
path.strokeStyle: root.dashedBorder ? ShapePath.DashLine : ShapePath.SolidLine
radius: Theme.radius * 2
leftBottomRadius: root.leftTail ? Theme.radius / 2 : Theme.radius * 2
rightBottomRadius: root.leftTail ? Theme.radius * 2 : Theme.radius / 2
layer.enabled: root.dropShadow
layer.effect: DropShadow {
verticalOffset: 3
radius: 8
samples: 15
fast: true
cached: true
color: Theme.palette.dropShadow
}
}
}