2026-01-15 01:13:17 +01:00
|
|
|
import QtQuick
|
2026-01-18 18:26:49 +01:00
|
|
|
import Quickshell.Wayland
|
2026-02-11 00:32:27 +01:00
|
|
|
import Quickshell.Widgets
|
|
|
|
|
import Quickshell
|
2026-01-19 12:45:35 +01:00
|
|
|
import qs
|
|
|
|
|
import qs.settings
|
|
|
|
|
import qs.reusables
|
2026-02-11 00:32:27 +01:00
|
|
|
import QtQuick.Layouts
|
2026-01-15 01:13:17 +01:00
|
|
|
|
2026-01-18 18:26:49 +01:00
|
|
|
Rectangle {
|
|
|
|
|
id: container
|
|
|
|
|
radius: implicitHeight / 2
|
2026-01-26 18:20:36 +01:00
|
|
|
color: Colors.surfaceContainer
|
2026-01-18 23:18:42 +01:00
|
|
|
implicitWidth: root.implicitWidth
|
2026-01-18 18:26:49 +01:00
|
|
|
implicitHeight: Settings.config.barHeight - 10
|
|
|
|
|
Item {
|
|
|
|
|
id: root
|
2026-01-21 18:11:12 +01:00
|
|
|
anchors.centerIn: parent
|
2026-01-18 18:26:49 +01:00
|
|
|
readonly property var activeWindow: ToplevelManager.activeToplevel
|
2026-02-11 00:32:27 +01:00
|
|
|
implicitWidth: titleLayout.implicitWidth
|
2026-01-21 18:11:12 +01:00
|
|
|
implicitHeight: titleText.implicitHeight
|
2026-02-11 00:32:27 +01:00
|
|
|
RowLayout {
|
|
|
|
|
id: titleLayout
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
spacing: 5
|
|
|
|
|
|
|
|
|
|
ClippingWrapperRectangle {
|
|
|
|
|
radius: 30
|
|
|
|
|
Layout.leftMargin: 10
|
|
|
|
|
IconImage {
|
|
|
|
|
id: icon
|
2026-02-12 19:45:10 +01:00
|
|
|
source: root.activeWindow ? root.activeWindow.activated ? Quickshell.iconPath(root.activeWindow.appId, "") : "" : ""
|
|
|
|
|
implicitSize: root.activeWindow ? root.activeWindow.activated ? 16 : 0 : 0
|
2026-02-11 00:32:27 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
CustomText {
|
|
|
|
|
id: titleText
|
|
|
|
|
Layout.rightMargin: 10
|
2026-02-12 19:23:48 +01:00
|
|
|
Layout.maximumWidth: 300
|
2026-02-11 00:32:27 +01:00
|
|
|
text: root.activeWindow ? root.activeWindow.activated ? root.activeWindow.title : "Desktop" : "Desktop"
|
|
|
|
|
onTextChanged: {
|
|
|
|
|
console.log(root.activeWindow.title);
|
|
|
|
|
console.log(icon.source);
|
|
|
|
|
}
|
|
|
|
|
elide: Text.ElideRight
|
|
|
|
|
}
|
2026-01-18 18:26:49 +01:00
|
|
|
}
|
2026-01-15 01:13:17 +01:00
|
|
|
}
|
|
|
|
|
}
|