From 60858f6f02fb7dc04e727db89090e7b83399803a Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 11 May 2025 23:55:05 +1000 Subject: feat: session menu --- modules/session/Background.qml | 70 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 modules/session/Background.qml (limited to 'modules/session/Background.qml') diff --git a/modules/session/Background.qml b/modules/session/Background.qml new file mode 100644 index 0000000..4b4b92e --- /dev/null +++ b/modules/session/Background.qml @@ -0,0 +1,70 @@ +import "root:/services" +import "root:/config" +import QtQuick +import QtQuick.Shapes + +Shape { + id: root + + required property real wrapperWidth + required property real wrapperHeight + readonly property real rounding: BorderConfig.rounding + readonly property bool flatten: wrapperWidth < rounding * 2 + readonly property real roundingX: flatten ? wrapperWidth / 2 : rounding + + preferredRendererType: Shape.CurveRenderer + opacity: Colours.transparency.enabled ? Colours.transparency.base : 1 + + ShapePath { + strokeWidth: -1 + fillColor: BorderConfig.colour + + startX: root.wrapperWidth - 1 + + PathArc { + relativeX: -root.roundingX + relativeY: root.rounding + radiusX: Math.min(root.rounding, root.wrapperWidth) + radiusY: root.rounding + } + PathLine { + x: root.roundingX + relativeY: 0 + } + PathArc { + relativeX: -root.roundingX + relativeY: root.rounding + radiusX: Math.min(root.rounding, root.wrapperWidth) + radiusY: root.rounding + direction: PathArc.Counterclockwise + } + PathLine { + y: root.wrapperHeight - root.rounding * 2 + } + PathArc { + relativeX: root.roundingX + relativeY: root.rounding + radiusX: Math.min(root.rounding, root.wrapperWidth) + radiusY: root.rounding + direction: PathArc.Counterclockwise + } + PathLine { + x: (root.flatten ? root.roundingX : root.wrapperWidth - root.rounding) - 1 + relativeY: 0 + } + PathArc { + relativeX: root.roundingX + relativeY: root.rounding + radiusX: Math.min(root.rounding, root.wrapperWidth) + radiusY: root.rounding + } + + Behavior on fillColor { + ColorAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard + } + } + } +} -- cgit v1.2.3-freya