blob: 932ba4c9e4ead98e22a96a07f999ba76318003a5 (
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
|
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Hyprland
import Quickshell.Widgets
import qs.components
import qs.config
Rectangle {
id: root
property var toplevel: Hyprland.activeToplevel
property var icon: Quickshell.iconPath(AppSearch.guessIcon(toplevel?.wayland?.appId), "image-missing")
// use IRect
implicitWidth: rowLayout.implicitWidth + General.rectMargin * 4
implicitHeight: rowLayout.implicitHeight + General.rectMargin * 2
anchors.centerIn: parent
color: Colors.alt
radius: Style.rounding.smaller
RowLayout {
id: rowLayout
anchors.centerIn: parent
spacing: Bar.resourceIconTextSpacing
IconImage {
source: root.icon
implicitWidth: Bar.appIconSize
implicitHeight: Bar.appIconSize
Layout.fillHeight: true
Layout.fillWidth: false
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
}
IText {
// TOOD: if not exist, use lazyloader or something hide this
font.pixelSize: General.fontSize
text: root?.toplevel?.title || ""
}
}
}
|