From bed6f7c5d5cd8f371524176c1fc7a55fe7ecc9bb Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Fri, 27 Jun 2025 21:46:24 +1000 Subject: internal: windowinfo pass in client So it can be used for clients other than the active one Also fix text below screencopyview --- modules/windowinfo/Buttons.qml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'modules/windowinfo/Buttons.qml') diff --git a/modules/windowinfo/Buttons.qml b/modules/windowinfo/Buttons.qml index c790a35..6b24cf3 100644 --- a/modules/windowinfo/Buttons.qml +++ b/modules/windowinfo/Buttons.qml @@ -8,6 +8,7 @@ import QtQuick.Layouts ColumnLayout { id: root + required property var client property bool moveToWsExpanded anchors.fill: parent @@ -78,7 +79,7 @@ ColumnLayout { Button { required property int index readonly property int wsId: Math.floor((Hyprland.activeWsId - 1) / 10) * 10 + index + 1 - readonly property bool isCurrent: Hyprland.activeToplevel?.workspace.id === wsId + readonly property bool isCurrent: root.client?.workspace.id === wsId color: isCurrent ? Colours.palette.m3surfaceContainerHighest : Colours.palette.m3tertiaryContainer onColor: isCurrent ? Colours.palette.m3onSurface : Colours.palette.m3onTertiaryContainer @@ -86,7 +87,7 @@ ColumnLayout { disabled: isCurrent function onClicked(): void { - Hyprland.dispatch(`movetoworkspace ${wsId},address:0x${Hyprland.activeToplevel?.address}`); + Hyprland.dispatch(`movetoworkspace ${wsId},address:0x${root.client?.address}`); } } } @@ -107,20 +108,20 @@ ColumnLayout { Layout.rightMargin: Appearance.padding.large Layout.bottomMargin: Appearance.padding.large - spacing: Hyprland.activeToplevel?.lastIpcObject.floating ? Appearance.spacing.normal : Appearance.spacing.small + spacing: root.client?.lastIpcObject.floating ? Appearance.spacing.normal : Appearance.spacing.small Button { color: Colours.palette.m3secondaryContainer onColor: Colours.palette.m3onSecondaryContainer - text: Hyprland.activeToplevel?.lastIpcObject.floating ? qsTr("Tile") : qsTr("Float") + text: root.client?.lastIpcObject.floating ? qsTr("Tile") : qsTr("Float") function onClicked(): void { - Hyprland.dispatch(`togglefloating address:0x${Hyprland.activeToplevel?.address}`); + Hyprland.dispatch(`togglefloating address:0x${root.client?.address}`); } } Loader { - active: Hyprland.activeToplevel?.lastIpcObject.floating + active: root.client?.lastIpcObject.floating asynchronous: true Layout.fillWidth: active Layout.leftMargin: active ? 0 : -parent.spacing @@ -129,10 +130,10 @@ ColumnLayout { sourceComponent: Button { color: Colours.palette.m3secondaryContainer onColor: Colours.palette.m3onSecondaryContainer - text: Hyprland.activeToplevel?.lastIpcObject.pinned ? qsTr("Unpin") : qsTr("Pin") + text: root.client?.lastIpcObject.pinned ? qsTr("Unpin") : qsTr("Pin") function onClicked(): void { - Hyprland.dispatch(`pin address:0x${Hyprland.activeToplevel?.address}`); + Hyprland.dispatch(`pin address:0x${root.client?.address}`); } } } @@ -143,7 +144,7 @@ ColumnLayout { text: qsTr("Kill") function onClicked(): void { - Hyprland.dispatch(`movetoworkspace ${wsId},address:0x${Hyprland.activeToplevel?.address}`); + Hyprland.dispatch(`movetoworkspace ${wsId},address:0x${root.client?.address}`); } } } -- cgit v1.2.3-freya