49 lines
1.5 KiB
QML
Raw Permalink Normal View History

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
import qs
import qs.settings
import qs.reusables
2026-02-11 00:32:27 +01:00
import QtQuick.Layouts
2026-01-18 18:26:49 +01:00
Rectangle {
id: container
radius: implicitHeight / 2
2026-02-13 22:58:33 +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"
2026-02-15 13:50:23 +01:00
onTextChanged: {}
2026-02-11 00:32:27 +01:00
elide: Text.ElideRight
}
2026-01-18 18:26:49 +01:00
}
}
}