summaryrefslogtreecommitdiff
path: root/modules/bar/components/Power.qml
blob: a870cb35d521ea57c30908cf4eb0394847c2be85 (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
import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell

MaterialIcon {
    text: "power_settings_new"
    color: Colours.palette.m3error
    font.bold: true
    font.pointSize: Appearance.font.size.normal

    StateLayer {
        anchors.fill: undefined
        anchors.centerIn: parent
        anchors.horizontalCenterOffset: 1

        implicitWidth: parent.implicitHeight + Appearance.padding.small * 2
        implicitHeight: implicitWidth

        radius: Appearance.rounding.full

        function onClicked(): void {
            const v = Visibilities.screens[QsWindow.window.screen];
            v.session = !v.session;
        }
    }
}