From 63da636144635e5aa6b7ff1a2d2eec2a1e35aafa Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 27 May 2025 10:42:08 +0800 Subject: internal: bar only vertical The bar can only be vertical Remove box, boxlayout and anchortext Add StyledClippingRect --- widgets/AnchorText.qml | 17 ----------------- widgets/Box.qml | 30 ------------------------------ widgets/BoxLayout.qml | 16 ---------------- widgets/StateLayer.qml | 10 +--------- widgets/StyledClippingRect.qml | 17 +++++++++++++++++ widgets/StyledRect.qml | 2 -- 6 files changed, 18 insertions(+), 74 deletions(-) delete mode 100644 widgets/AnchorText.qml delete mode 100644 widgets/Box.qml delete mode 100644 widgets/BoxLayout.qml create mode 100644 widgets/StyledClippingRect.qml (limited to 'widgets') diff --git a/widgets/AnchorText.qml b/widgets/AnchorText.qml deleted file mode 100644 index 03514dd..0000000 --- a/widgets/AnchorText.qml +++ /dev/null @@ -1,17 +0,0 @@ -import "root:/config" -import QtQuick - -StyledText { - id: root - - required property Item prevAnchor - property bool vertical: parent.vertical ?? false - - anchors.left: vertical ? undefined : prevAnchor.right - anchors.leftMargin: vertical ? 0 : Appearance.padding.smaller - anchors.top: vertical ? prevAnchor.bottom : undefined - anchors.topMargin: vertical ? Appearance.padding.smaller : 0 - - anchors.horizontalCenter: vertical ? prevAnchor.horizontalCenter : undefined - anchors.verticalCenter: vertical ? undefined : prevAnchor.verticalCenter -} diff --git a/widgets/Box.qml b/widgets/Box.qml deleted file mode 100644 index 9c786c7..0000000 --- a/widgets/Box.qml +++ /dev/null @@ -1,30 +0,0 @@ -import "root:/config" -import QtQuick - -Grid { - property bool vertical: parent.vertical ?? false // Propagate from parent - - flow: vertical ? Grid.TopToBottom : Grid.LeftToRight - spacing: Appearance.spacing.small - - onVerticalChanged: { - if (vertical) { - rows = -1; - columns = 1; - } else { - columns = -1; - rows = 1; - } - } - - add: Transition { - NumberAnimation { - properties: "scale" - from: 0 - to: 1 - duration: Appearance.anim.durations.normal - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.standardDecel - } - } -} diff --git a/widgets/BoxLayout.qml b/widgets/BoxLayout.qml deleted file mode 100644 index d000bda..0000000 --- a/widgets/BoxLayout.qml +++ /dev/null @@ -1,16 +0,0 @@ -import "root:/config" -import QtQuick.Layouts - -GridLayout { - property bool vertical: parent.vertical ?? false // Propagate from parent - property bool homogenous: false - property int spacing: Appearance.spacing.small - - flow: vertical ? GridLayout.TopToBottom : GridLayout.LeftToRight - uniformCellWidths: homogenous || vertical - uniformCellHeights: homogenous || !vertical - rows: vertical ? -1 : 1 - columns: vertical ? 1 : -1 - rowSpacing: spacing - columnSpacing: spacing -} diff --git a/widgets/StateLayer.qml b/widgets/StateLayer.qml index 8f39341..1c8f947 100644 --- a/widgets/StateLayer.qml +++ b/widgets/StateLayer.qml @@ -3,7 +3,7 @@ import "root:/services" import "root:/config" import QtQuick -Rectangle { +StyledRect { id: root readonly property alias hovered: mouse.hovered @@ -40,12 +40,4 @@ Rectangle { easing.bezierCurve: Appearance.anim.curves.standard } } - - Behavior on color { - ColorAnimation { - duration: Appearance.anim.durations.normal - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.standard - } - } } diff --git a/widgets/StyledClippingRect.qml b/widgets/StyledClippingRect.qml new file mode 100644 index 0000000..477ce86 --- /dev/null +++ b/widgets/StyledClippingRect.qml @@ -0,0 +1,17 @@ +import "root:/config" +import Quickshell.Widgets +import QtQuick + +ClippingRectangle { + id: root + + color: "transparent" + + Behavior on color { + ColorAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard + } + } +} diff --git a/widgets/StyledRect.qml b/widgets/StyledRect.qml index 8b3ac05..108e5e0 100644 --- a/widgets/StyledRect.qml +++ b/widgets/StyledRect.qml @@ -4,8 +4,6 @@ import QtQuick Rectangle { id: root - property bool vertical: parent?.vertical ?? false // Convenience property for propagation to children - color: "transparent" Behavior on color { -- cgit v1.2.3-freya