diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-30 23:26:16 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-30 23:26:16 +1000 |
| commit | 9339394e07bda1c51e0bc484d09e5419a6ad2d29 (patch) | |
| tree | 1958c2d36bd3af4ded227f94afce131fe3f9e040 /modules/bar/Pills.qml | |
| parent | colours: adjust layer brightness when transparent (diff) | |
| download | caelestia-shell-9339394e07bda1c51e0bc484d09e5419a6ad2d29.tar.gz caelestia-shell-9339394e07bda1c51e0bc484d09e5419a6ad2d29.tar.bz2 caelestia-shell-9339394e07bda1c51e0bc484d09e5419a6ad2d29.zip | |
bar: use loader instead of swipeview
Also properly set it up
Make network reloadable cause getting is pretty slow
Diffstat (limited to 'modules/bar/Pills.qml')
| -rw-r--r-- | modules/bar/Pills.qml | 142 |
1 files changed, 70 insertions, 72 deletions
diff --git a/modules/bar/Pills.qml b/modules/bar/Pills.qml index 05b29a9..49dbe5b 100644 --- a/modules/bar/Pills.qml +++ b/modules/bar/Pills.qml @@ -8,104 +8,102 @@ import Quickshell.Wayland import QtQuick import QtQuick.Layouts -Item { - BoxLayout { - id: root +BoxLayout { + id: root - function get(horiz, vert) { - return BarConfig.vertical ? vert : horiz; - } + function get(horiz, vert) { + return BarConfig.vertical ? vert : horiz; + } - spacing: Appearance.padding.large + spacing: Appearance.padding.large - 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) + 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 { - OsIcon { - id: osIcon + Pill { + 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.large, 0) - anchors.top: root.get(undefined, osIcon.bottom) - anchors.topMargin: root.get(0, Appearance.padding.large) + anchors.left: root.get(osIcon.right, undefined) + anchors.leftMargin: root.get(Appearance.padding.large, 0) + anchors.top: root.get(undefined, osIcon.bottom) + anchors.topMargin: root.get(0, Appearance.padding.large) - 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) } + } - Item { - Layout.fillWidth: true - Layout.fillHeight: true - } + Item { + Layout.fillWidth: true + Layout.fillHeight: true + } - Pill { - ActiveWindow { - vertical: BarConfig.vertical + Pill { + 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) } + } - Item { - Layout.fillWidth: true - Layout.fillHeight: true - } + Item { + Layout.fillWidth: true + Layout.fillHeight: true + } - Pill { - Tray { - vertical: BarConfig.vertical + Pill { + Tray { + 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 { - Clock { - id: clock + Pill { + Clock { + id: clock - vertical: BarConfig.vertical + 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) + } - StatusIcons { - anchors.left: root.get(clock.right, undefined) - anchors.leftMargin: root.get(Appearance.padding.large, 0) - anchors.top: root.get(undefined, clock.bottom) - anchors.topMargin: root.get(0, Appearance.padding.large) + StatusIcons { + anchors.left: root.get(clock.right, undefined) + anchors.leftMargin: root.get(Appearance.padding.large, 0) + anchors.top: root.get(undefined, clock.bottom) + anchors.topMargin: root.get(0, Appearance.padding.large) - 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 { - // Make circle - Layout.maximumWidth: BarConfig.sizes.height - Layout.maximumHeight: BarConfig.sizes.height + Pill { + // Make circle + Layout.maximumWidth: BarConfig.sizes.height + Layout.maximumHeight: BarConfig.sizes.height - Power { - // Center in pill - x: (BarConfig.sizes.height - width) / 2 + Power { + // Center in pill + x: (BarConfig.sizes.height - width) / 2 - 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) } } |