From 3fd429c9f30e1b8cffdeca2778c7eb20f8a0647f Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 13 May 2025 19:01:00 +1000 Subject: session: move to drawers --- modules/session/Background.qml | 105 +++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 56 deletions(-) (limited to 'modules/session/Background.qml') diff --git a/modules/session/Background.qml b/modules/session/Background.qml index 4b4b92e..75940d3 100644 --- a/modules/session/Background.qml +++ b/modules/session/Background.qml @@ -3,68 +3,61 @@ import "root:/config" import QtQuick import QtQuick.Shapes -Shape { +ShapePath { id: root - required property real wrapperWidth - required property real wrapperHeight + required property Wrapper wrapper readonly property real rounding: BorderConfig.rounding - readonly property bool flatten: wrapperWidth < rounding * 2 - readonly property real roundingX: flatten ? wrapperWidth / 2 : rounding + readonly property bool flatten: wrapper.width < rounding * 2 + readonly property real roundingX: flatten ? wrapper.width / 2 : rounding - preferredRendererType: Shape.CurveRenderer - opacity: Colours.transparency.enabled ? Colours.transparency.base : 1 + strokeWidth: -1 + fillColor: BorderConfig.colour - 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 - } + PathArc { + relativeX: -root.roundingX + relativeY: root.rounding + radiusX: Math.min(root.rounding, root.wrapper.width) + radiusY: root.rounding + } + PathLine { + relativeX: -(root.wrapper.width - root.roundingX * 2) + relativeY: 0 + } + PathArc { + relativeX: -root.roundingX + relativeY: root.rounding + radiusX: Math.min(root.rounding, root.wrapper.width) + radiusY: root.rounding + direction: PathArc.Counterclockwise + } + PathLine { + relativeX: 0 + relativeY: root.wrapper.height - root.rounding * 4 + } + PathArc { + relativeX: root.roundingX + relativeY: root.rounding + radiusX: Math.min(root.rounding, root.wrapper.width) + radiusY: root.rounding + direction: PathArc.Counterclockwise + } + PathLine { + relativeX: root.wrapper.width - root.roundingX * 2 + relativeY: 0 + } + PathArc { + relativeX: root.roundingX + relativeY: root.rounding + radiusX: Math.min(root.rounding, root.wrapper.width) + radiusY: root.rounding + } - Behavior on fillColor { - ColorAnimation { - duration: Appearance.anim.durations.normal - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.standard - } + Behavior on fillColor { + ColorAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard } } } -- cgit v1.2.3-freya