mirror of
https://github.com/danbulant/dots-hyprland
synced 2026-05-24 12:22:09 +00:00
53 lines
1.8 KiB
QML
53 lines
1.8 KiB
QML
import qs.services
|
|
import qs.modules.common
|
|
import qs.modules.common.widgets
|
|
import qs
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import Quickshell
|
|
import Quickshell.Wayland
|
|
import Quickshell.Hyprland
|
|
|
|
Item {
|
|
id: root
|
|
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(root.QsWindow.window?.screen)
|
|
readonly property Toplevel activeWindow: ToplevelManager.activeToplevel
|
|
|
|
property string activeWindowAddress: `0x${activeWindow?.HyprlandToplevel?.address}`
|
|
property bool focusingThisMonitor: HyprlandData.activeWorkspace?.monitor == monitor?.name
|
|
property var biggestWindow: HyprlandData.biggestWindowForWorkspace(HyprlandData.monitors[root.monitor?.id]?.activeWorkspace.id)
|
|
|
|
implicitWidth: colLayout.implicitWidth
|
|
|
|
ColumnLayout {
|
|
id: colLayout
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
anchors.left: parent.left
|
|
anchors.right: parent.right
|
|
spacing: -4
|
|
|
|
StyledText {
|
|
Layout.fillWidth: true
|
|
font.pixelSize: Appearance.font.pixelSize.smaller
|
|
color: Appearance.colors.colSubtext
|
|
elide: Text.ElideRight
|
|
text: root.focusingThisMonitor && root.activeWindow?.activated && root.biggestWindow ?
|
|
root.activeWindow?.appId :
|
|
(root.biggestWindow?.class) ?? Translation.tr("Desktop")
|
|
|
|
}
|
|
|
|
StyledText {
|
|
Layout.fillWidth: true
|
|
font.pixelSize: Appearance.font.pixelSize.small
|
|
color: Appearance.colors.colOnLayer0
|
|
elide: Text.ElideRight
|
|
text: root.focusingThisMonitor && root.activeWindow?.activated && root.biggestWindow ?
|
|
root.activeWindow?.title :
|
|
(root.biggestWindow?.title) ?? `${Translation.tr("Workspace")} ${monitor?.activeWorkspace?.id}`
|
|
}
|
|
|
|
}
|
|
|
|
}
|