From 4167bdc70e55926f57e8710b74dc860fd1fc2a1c Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 20 Jul 2025 15:45:06 +0800 Subject: Rect: use IRect with color animation --- bar/Bar.qml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'bar/Bar.qml') diff --git a/bar/Bar.qml b/bar/Bar.qml index 4dac781..87ab667 100644 --- a/bar/Bar.qml +++ b/bar/Bar.qml @@ -21,7 +21,7 @@ Scope { } implicitHeight: child.implicitHeight + Bar.topMargin * 2 - Rectangle { + IRect { id: child radius: Bar.borderRadius implicitHeight: Bar.height @@ -39,12 +39,19 @@ Scope { color: "transparent" - Rectangle { + IRect { anchors.left: parent.left width: leftRow.width + leftRow.anchors.leftMargin - leftSpacer.width height: leftRow.height color: Qt.rgba(WallustColors.background.r, WallustColors.background.g, WallustColors.background.b, Bar.bgTransparency) radius: Bar.moduleRadius + + Behavior on color { + ColorAnimation { + duration: General.animationDuration + easing.type: Easing.InOutQuad + } + } } RowLayout { @@ -81,12 +88,19 @@ Scope { } } - Rectangle { + IRect { anchors.right: parent.right width: rightRow.width + rightRow.anchors.rightMargin - rightSpacer.width height: rightRow.height color: Qt.rgba(WallustColors.background.r, WallustColors.background.g, WallustColors.background.b, Bar.bgTransparency) radius: Bar.moduleRadius + + Behavior on color { + ColorAnimation { + duration: General.animationDuration + easing.type: Easing.InOutQuad + } + } } RowLayout { -- cgit v1.2.3