diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-22 00:07:11 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-22 00:07:11 +1000 |
| commit | 60deccddf0dca955de035a9f096fd47abe8d1786 (patch) | |
| tree | 64d1404f604b1d225b021806ba8f1a3f5922e368 /modules/windowinfo/Details.qml | |
| parent | winfo: add buttons (diff) | |
| download | caelestia-shell-60deccddf0dca955de035a9f096fd47abe8d1786.tar.gz caelestia-shell-60deccddf0dca955de035a9f096fd47abe8d1786.tar.bz2 caelestia-shell-60deccddf0dca955de035a9f096fd47abe8d1786.zip | |
winfo: add no active client placeholders
Also change close button to kill
Diffstat (limited to 'modules/windowinfo/Details.qml')
| -rw-r--r-- | modules/windowinfo/Details.qml | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/modules/windowinfo/Details.qml b/modules/windowinfo/Details.qml index b103711..7b9f9b8 100644 --- a/modules/windowinfo/Details.qml +++ b/modules/windowinfo/Details.qml @@ -14,7 +14,7 @@ ColumnLayout { Label { Layout.topMargin: Appearance.padding.large * 2 - text: Hyprland.activeClient.title + text: Hyprland.activeClient?.title ?? "No active client" wrapMode: Text.WrapAtWordBoundaryOrAnywhere font.pointSize: Appearance.font.size.large @@ -22,7 +22,7 @@ ColumnLayout { } Label { - text: Hyprland.activeClient.wmClass + text: Hyprland.activeClient?.wmClass ?? "No active client" color: Colours.palette.m3tertiary font.pointSize: Appearance.font.size.larger @@ -41,74 +41,78 @@ ColumnLayout { Detail { icon: "location_on" - text: qsTr("Address: %1").arg(Hyprland.activeClient.address) + text: qsTr("Address: %1").arg(Hyprland.activeClient?.address ?? "unknown") color: Colours.palette.m3primary } Detail { icon: "location_searching" - text: qsTr("Position: %1, %2").arg(Hyprland.activeClient.x).arg(Hyprland.activeClient.y) + text: qsTr("Position: %1, %2").arg(Hyprland.activeClient?.x ?? -1).arg(Hyprland.activeClient?.y ?? -1) } Detail { icon: "resize" - text: qsTr("Size: %1 x %2").arg(Hyprland.activeClient.width).arg(Hyprland.activeClient.height) + text: qsTr("Size: %1 x %2").arg(Hyprland.activeClient?.width ?? -1).arg(Hyprland.activeClient?.height ?? -1) color: Colours.palette.m3tertiary } Detail { icon: "workspaces" - text: qsTr("Workspace: %1 (%2)").arg(Hyprland.activeClient.workspace.name).arg(Hyprland.activeClient.workspace.id) + text: qsTr("Workspace: %1 (%2)").arg(Hyprland.activeClient?.workspace.name ?? -1).arg(Hyprland.activeClient?.workspace.id ?? -1) color: Colours.palette.m3secondary } Detail { icon: "desktop_windows" text: { - const mon = Hyprland.activeClient.monitor; - return qsTr("Monitor: %1 (%2) at %3, %4").arg(mon.name).arg(mon.id).arg(mon.x).arg(mon.y); + const mon = Hyprland.activeClient?.monitor; + if (mon) + return qsTr("Monitor: %1 (%2) at %3, %4").arg(mon.name).arg(mon.id).arg(mon.x).arg(mon.y); + return qsTr("Monitor: unknown"); } } Detail { icon: "page_header" - text: qsTr("Initial title: %1").arg(Hyprland.activeClient.initialTitle) + text: qsTr("Initial title: %1").arg(Hyprland.activeClient?.initialTitle ?? "unknown") color: Colours.palette.m3tertiary } Detail { icon: "category" - text: qsTr("Initial class: %1").arg(Hyprland.activeClient.initialClass) + text: qsTr("Initial class: %1").arg(Hyprland.activeClient?.initialClass ?? "unknown") } Detail { icon: "account_tree" - text: qsTr("Process id: %1").arg(Hyprland.activeClient.pid) + text: qsTr("Process id: %1").arg(Hyprland.activeClient?.pid ?? -1) color: Colours.palette.m3primary } Detail { icon: "picture_in_picture_center" - text: qsTr("Floating: %1").arg(Hyprland.activeClient.floating ? "yes" : "no") + text: qsTr("Floating: %1").arg(Hyprland.activeClient?.floating ? "yes" : "no") color: Colours.palette.m3secondary } Detail { icon: "gradient" - text: qsTr("Xwayland: %1").arg(Hyprland.activeClient.lastIpcObject.xwayland ? "yes" : "no") + text: qsTr("Xwayland: %1").arg(Hyprland.activeClient?.lastIpcObject.xwayland ? "yes" : "no") } Detail { icon: "keep" - text: qsTr("Pinned: %1").arg(Hyprland.activeClient.lastIpcObject.pinned ? "yes" : "no") + text: qsTr("Pinned: %1").arg(Hyprland.activeClient?.lastIpcObject.pinned ? "yes" : "no") color: Colours.palette.m3secondary } Detail { icon: "fullscreen" text: { - const fs = Hyprland.activeClient.fullscreen; - return qsTr("Fullscreen state: %1").arg(fs == 0 ? "off" : fs == 1 ? "maximised" : "on"); + const fs = Hyprland.activeClient?.fullscreen; + if (fs) + return qsTr("Fullscreen state: %1").arg(fs == 0 ? "off" : fs == 1 ? "maximised" : "on"); + return qsTr("Fullscreen state: unknown"); } color: Colours.palette.m3tertiary } |