diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-29 10:29:30 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-29 10:29:30 +1000 |
| commit | 5fd8d0f6da23030cbe043c5fd59284393781e23a (patch) | |
| tree | 718c188d60eeb2de460d6fd7d15e17814d67014b /modules/bar/Bar.qml | |
| parent | refactor: move bar components into folder (diff) | |
| download | caelestia-shell-5fd8d0f6da23030cbe043c5fd59284393781e23a.tar.gz caelestia-shell-5fd8d0f6da23030cbe043c5fd59284393781e23a.tar.bz2 caelestia-shell-5fd8d0f6da23030cbe043c5fd59284393781e23a.zip | |
refactor: use anchors instead of layouts
Diffstat (limited to 'modules/bar/Bar.qml')
| -rw-r--r-- | modules/bar/Bar.qml | 75 |
1 files changed, 49 insertions, 26 deletions
diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 8eccf07..35c77e0 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -5,6 +5,7 @@ import "components/workspaces" import Quickshell import Quickshell.Wayland import QtQuick +import QtQuick.Controls Variants { model: Quickshell.screens @@ -13,46 +14,68 @@ Variants { id: win required property ShellScreen modelData - readonly property bool vertical: BarConfig.vertical screen: modelData namespace: "caelestia-bar" color: "transparent" + width: content.width + height: content.height + anchors.top: true anchors.left: true - anchors.right: !vertical - anchors.bottom: vertical + anchors.right: true - width: contents.implicitWidth - height: contents.implicitHeight + // Connections { + // target: BarConfig - Box { - id: contents + // function onVerticalChanged(): void { + // win.visible = false; + // if (BarConfig.vertical) { + // win.anchors.right = false; + // win.anchors.bottom = true; + // } else { + // win.anchors.bottom = false; + // win.anchors.right = true; + // } + // win.visible = true; + // } + // } - padding: [Appearance.padding.normal, Appearance.padding.large, 0, Appearance.padding.large] + // SwipeView { + // anchors.fill: parent - BoxLayout { - vertical: win.vertical - spacing: Appearance.spacing.larger - padding: [0, Appearance.padding.large] - color: Appearance.alpha(Appearance.colours.base, false) - radius: Appearance.rounding.full + // } + Pills { + id: content + } - OsIcon {} + // Box { + // id: contents - Workspaces { - vertical: win.vertical - } + // padding: [Appearance.padding.normal, Appearance.padding.large, 0, Appearance.padding.large] - Clock { - vertical: win.vertical - } + // BoxLayout { + // vertical: win.vertical + // spacing: Appearance.spacing.larger + // padding: [0, Appearance.padding.large] + // color: Appearance.alpha(Appearance.colours.base, false) + // radius: Appearance.rounding.full - ActiveWindow { - vertical: win.vertical - } - } - } + // OsIcon {} + + // Workspaces { + // vertical: win.vertical + // } + + // Clock { + // vertical: win.vertical + // } + + // ActiveWindow { + // vertical: win.vertical + // } + // } + // } } } |