diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-29 14:05:31 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-29 14:05:31 +1000 |
| commit | b59dde6c5f996f9c6891bad67e9fb12829d9b364 (patch) | |
| tree | 8bbe36a5dc139c889fed26834ebd8f15630debf0 /modules/bar/Pills.qml | |
| parent | refactor: occupiedbg comp anim (diff) | |
| download | caelestia-shell-b59dde6c5f996f9c6891bad67e9fb12829d9b364.tar.gz caelestia-shell-b59dde6c5f996f9c6891bad67e9fb12829d9b364.tar.bz2 caelestia-shell-b59dde6c5f996f9c6891bad67e9fb12829d9b364.zip | |
bar: use swipeview
Diffstat (limited to 'modules/bar/Pills.qml')
| -rw-r--r-- | modules/bar/Pills.qml | 110 |
1 files changed, 43 insertions, 67 deletions
diff --git a/modules/bar/Pills.qml b/modules/bar/Pills.qml index dffd65f..2d6dfda 100644 --- a/modules/bar/Pills.qml +++ b/modules/bar/Pills.qml @@ -4,70 +4,67 @@ import "root:/widgets" import "root:/config" import "components" import "components/workspaces" -import Quickshell import Quickshell.Wayland import QtQuick -import QtQuick.Controls Item { - id: root + Item { + id: root - function get(horiz, vert) { - return BarConfig.vertical ? vert : horiz; - } - - anchors.fill: parent - anchors.leftMargin: get(BarConfig.sizes.floatingGapLarge, BarConfig.sizes.floatingGap) - anchors.topMargin: get(BarConfig.sizes.floatingGap, BarConfig.sizes.floatingGapLarge) - anchors.rightMargin: get(BarConfig.sizes.floatingGapLarge, 0) - anchors.bottomMargin: get(0, BarConfig.sizes.floatingGapLarge) + function get(horiz, vert) { + return BarConfig.vertical ? vert : horiz; + } - width: get(-1, BarConfig.sizes.height + BarConfig.sizes.floatingGap) - height: get(BarConfig.sizes.height + BarConfig.sizes.floatingGap, -1) + anchors.fill: parent + anchors.leftMargin: get(BarConfig.sizes.floatingGapLarge, BarConfig.sizes.floatingGap) + anchors.topMargin: get(BarConfig.sizes.floatingGap, BarConfig.sizes.floatingGapLarge) + anchors.rightMargin: get(BarConfig.sizes.floatingGapLarge, 0) + anchors.bottomMargin: get(0, BarConfig.sizes.floatingGapLarge) - Pill { - anchors.left: parent.left + Pill { + anchors.left: parent.left - OsIcon { - id: osIcon + OsIcon { + id: osIcon - anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) - anchors.verticalCenter: root.get(parent.verticalCenter, undefined) - } + anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) + anchors.verticalCenter: root.get(parent.verticalCenter, undefined) + } - Workspaces { - vertical: BarConfig.vertical + Workspaces { + vertical: BarConfig.vertical - anchors.left: root.get(osIcon.right, undefined) - anchors.leftMargin: root.get(Appearance.padding.smaller, 0) - anchors.top: root.get(undefined, osIcon.bottom) - anchors.topMargin: root.get(0, Appearance.padding.smaller) + anchors.left: root.get(osIcon.right, undefined) + anchors.leftMargin: root.get(Appearance.padding.smaller, 0) + anchors.top: root.get(undefined, osIcon.bottom) + anchors.topMargin: root.get(0, Appearance.padding.smaller) - anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) - anchors.verticalCenter: root.get(parent.verticalCenter, undefined) + anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) + anchors.verticalCenter: root.get(parent.verticalCenter, undefined) + } } - } - Pill { - anchors.horizontalCenter: root.get(parent.horizontalCenter, undefined) - anchors.verticalCenter: root.get(undefined, parent.verticalCenter) + Pill { + anchors.horizontalCenter: root.get(parent.horizontalCenter, undefined) + anchors.verticalCenter: root.get(undefined, parent.verticalCenter) - ActiveWindow { - vertical: BarConfig.vertical + ActiveWindow { + vertical: BarConfig.vertical - anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) - anchors.verticalCenter: root.get(parent.verticalCenter, undefined) + anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) + anchors.verticalCenter: root.get(parent.verticalCenter, undefined) + } } - } - Pill { - anchors.right: parent.right + Pill { + anchors.right: parent.right - Clock { - vertical: BarConfig.vertical + Clock { + vertical: BarConfig.vertical - anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) - anchors.verticalCenter: root.get(parent.verticalCenter, undefined) + anchors.horizontalCenter: root.get(undefined, parent.horizontalCenter) + anchors.verticalCenter: root.get(parent.verticalCenter, undefined) + } } } @@ -78,28 +75,7 @@ Item { radius: Appearance.rounding.full padding: BarConfig.vertical ? [Appearance.padding.large, 0] : [0, Appearance.padding.large] - anchors.top: parent.top - anchors.bottom: parent.bottom - - state: BarConfig.vertical ? "vertical" : "" - states: State { - name: "vertical" - - AnchorChanges { - target: pill - anchors.top: undefined - anchors.bottom: undefined - anchors.left: parent.left - anchors.right: parent.right - } - } - - transitions: Transition { - AnchorAnimation { - duration: Appearance.anim.durations.normal - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.emphasized - } - } + width: BarConfig.vertical ? BarConfig.sizes.height : implicitWidth + height: BarConfig.vertical ? implicitHeight : BarConfig.sizes.height } } |