2026-03-08 13:44:57 +01:00
|
|
|
import Quickshell
|
2026-03-19 11:32:23 +01:00
|
|
|
import Qt5Compat.GraphicalEffects
|
2026-03-08 13:44:57 +01:00
|
|
|
import Quickshell.Wayland
|
2026-03-20 10:34:10 +01:00
|
|
|
import Quickshell.Widgets
|
2026-03-08 13:44:57 +01:00
|
|
|
import QtQuick
|
2026-03-09 10:02:44 +01:00
|
|
|
import QtQuick.Layouts
|
2026-03-08 13:44:57 +01:00
|
|
|
import qs
|
|
|
|
|
import qs.widgets
|
|
|
|
|
import qs.settings
|
|
|
|
|
|
2026-03-20 10:34:10 +01:00
|
|
|
WrapperRectangle {
|
2026-03-08 13:44:57 +01:00
|
|
|
id: root
|
2026-03-20 10:34:10 +01:00
|
|
|
margin: Settings.config.barmargins
|
2026-03-19 11:32:23 +01:00
|
|
|
layer {
|
|
|
|
|
enabled: true
|
|
|
|
|
effect: DropShadow {
|
2026-03-23 11:22:31 +01:00
|
|
|
color: "#111111"
|
2026-03-19 11:32:23 +01:00
|
|
|
radius: 4
|
|
|
|
|
verticalOffset: 2
|
|
|
|
|
horizontalOffset: 2
|
|
|
|
|
samples: 18
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-03-08 13:44:57 +01:00
|
|
|
property var activeWindow: ToplevelManager.activeToplevel
|
|
|
|
|
property bool active: activeWindow ? activeWindow.activated ? true : false : false
|
|
|
|
|
radius: Settings.config.rounding
|
2026-03-19 11:32:23 +01:00
|
|
|
color: active ? Colors.base02 : "transparent"
|
2026-03-20 10:34:10 +01:00
|
|
|
implicitWidth: titleText.width + 40
|
|
|
|
|
implicitHeight: Settings.config.barHeight - margin * 2
|
|
|
|
|
child: Item {
|
|
|
|
|
RowLayout {
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
CText {
|
|
|
|
|
id: titleText
|
|
|
|
|
Layout.maximumWidth: 250
|
|
|
|
|
text: root.activeWindow ? root.activeWindow.activated ? root.activeWindow.title : "" : ""
|
|
|
|
|
elide: Text.ElideRight // Allows wrapping
|
|
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
|
|
|
|
}
|
2026-03-09 10:02:44 +01:00
|
|
|
}
|
2026-03-20 10:34:10 +01:00
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2026-03-08 13:44:57 +01:00
|
|
|
}
|
|
|
|
|
}
|