summaryrefslogtreecommitdiff
path: root/modules/bar/Bar.qml
blob: 5aa18f75d29d229910a18a7940af6ed75935f3f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import "root:/widgets"
import "root:/config"
import Quickshell
import Quickshell.Wayland

Variants {
    model: Quickshell.screens

    WlrLayershell {
        id: win

        property var modelData
        property bool vertical: false

        screen: modelData
        namespace: "caelestia-bar"
        color: Appearance.alpha(Appearance.colours.base, false)

        anchors {
            top: true
            left: true
            right: !vertical
            bottom: vertical
        }

        width: contents.implicitWidth + (vertical ? Appearance.padding.normal * 2 : 0)
        height: contents.implicitHeight + (vertical ? 0 : Appearance.padding.smaller * 2)

        Box {
            id: contents

            vertical: win.vertical
            spacing: Appearance.spacing.larger
            x: Appearance.padding.normal
            y: vertical ? Appearance.padding.normal : Appearance.padding.smaller

            OsIcon {}

            Clock {
                vertical: win.vertical
            }

            ActiveWindow {
                vertical: win.vertical
            }
        }
    }
}