summaryrefslogtreecommitdiff
path: root/modules/bar/popouts/ActiveWindow.qml
blob: d9e9b9e96a7449c6e3391a8af16bc088a66ff988 (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
49
50
import "root:/widgets"
import "root:/services"
import "root:/utils"
import "root:/config"
import Quickshell.Widgets
import Quickshell.Wayland
import QtQuick

Item {
    id: root

    implicitWidth: child.implicitWidth
    implicitHeight: child.implicitHeight

    Column {
        id: child

        anchors.centerIn: parent
        spacing: Appearance.spacing.normal

        StyledText {
            text: Hyprland.activeClient?.title ?? ""

            elide: Text.ElideRight
            width: preview.implicitWidth
        }

        StyledText {
            text: Hyprland.activeClient?.wmClass ?? ""

            elide: Text.ElideRight
            width: preview.implicitWidth
        }

        ClippingWrapperRectangle {
            color: "transparent"
            radius: Appearance.rounding.small

            ScreencopyView {
                id: preview

                captureSource: ToplevelManager.toplevels.values.find(t => t.title === Hyprland.activeClient?.title) ?? null
                live: true

                constraintSize.width: BarConfig.sizes.windowPreviewSize
                constraintSize.height: BarConfig.sizes.windowPreviewSize
            }
        }
    }
}