diff options
Diffstat (limited to 'modules/windowinfo/Buttons.qml')
| -rw-r--r-- | modules/windowinfo/Buttons.qml | 19 |
1 files changed, 10 insertions, 9 deletions
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}`); } } } |