Files
illogical-impulse/.config/quickshell/modules/bar/ActiveWindow.qml
T
2025-04-11 23:35:05 +02:00

44 lines
1.2 KiB
QML

import "../common"
import "../common/widgets"
import QtQuick
import QtQuick.Layouts
import Quickshell.Wayland
import Quickshell.Hyprland
Item {
required property var bar
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(bar.screen)
readonly property Toplevel activeWindow: ToplevelManager.activeToplevel
property int preferredWidth: 400
height: parent.height
width: colLayout.width
Layout.leftMargin: Appearance.rounding.screenRounding
ColumnLayout {
id: colLayout
anchors.centerIn: parent
spacing: -4
StyledText {
font.pointSize: Appearance.font.pointSize.smaller
color: Appearance.colors.colSubtext
Layout.preferredWidth: preferredWidth
elide: Text.ElideRight
text: activeWindow?.activated ? activeWindow?.appId : "Desktop"
}
StyledText {
font.pointSize: Appearance.font.pointSize.small
color: Appearance.colors.colOnLayer0
Layout.preferredWidth: preferredWidth
elide: Text.ElideRight
text: activeWindow?.activated ? activeWindow?.title : `Workspace ${monitor.activeWorkspace?.id}`
}
}
}