From 01d9c318593e1bf4eb81dc6e71dc4c20e8c9fa6a Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 29 Apr 2025 10:53:54 +1000 Subject: bar: fix alignment Also refactor box -> styledrect + paddedrect --- widgets/StyledRect.qml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 widgets/StyledRect.qml (limited to 'widgets/StyledRect.qml') diff --git a/widgets/StyledRect.qml b/widgets/StyledRect.qml new file mode 100644 index 0000000..f9d6ad1 --- /dev/null +++ b/widgets/StyledRect.qml @@ -0,0 +1,41 @@ +import "root:/config" +import QtQuick + +Rectangle { + id: root + + property bool animated: false + property bool vertical: false // Convenience property for propagation to children + + color: "transparent" + implicitWidth: childrenRect.width + implicitHeight: childrenRect.height + + Behavior on color { + ColorAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard + } + } + + Behavior on implicitWidth { + enabled: root.animated + + NumberAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.emphasized + } + } + + Behavior on implicitHeight { + enabled: root.animated + + NumberAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.emphasized + } + } +} -- cgit v1.2.3-freya