summaryrefslogtreecommitdiff
path: root/modules/bar/components/ActiveWindow.qml
blob: a87d17b47cf239fac29e7e9cf581ca0553dde87a (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
import "root:/widgets"
import "root:/services"
import "root:/utils"
import "root:/config"
import QtQuick

StyledRect {
    id: root

    property color colour: Appearance.colours.pink

    animate: true
    clip: true

    MaterialIcon {
        id: icon

        animate: true
        text: Icons.getAppCategoryIcon(Hyprland.activeClient?.wmClass, "desktop_windows")
        color: root.colour
    }

    AnchorText {
        prevAnchor: icon

        text: metrics.elidedText
        font.pointSize: metrics.font.pointSize
        font.family: metrics.font.family
        color: root.colour
        rotation: vertical ? 90 : 0
    }

    TextMetrics {
        id: metrics

        text: Hyprland.activeClient?.title ?? "Desktop"
        font.pointSize: Appearance.font.size.smaller
        font.family: Appearance.font.family.mono
        elide: Qt.ElideRight
        elideWidth: root.vertical ? BarConfig.sizes.maxLabelHeight : BarConfig.sizes.maxLabelWidth
    }
}