summaryrefslogtreecommitdiff
path: root/modules/windowinfo/Buttons.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-27 21:46:24 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-27 21:46:24 +1000
commitbed6f7c5d5cd8f371524176c1fc7a55fe7ecc9bb (patch)
tree0853ca45f51e2c7f688f6ad8d62e18c953e9ef04 /modules/windowinfo/Buttons.qml
parentinternal: use hyprlandtoplevel (diff)
downloadcaelestia-shell-bed6f7c5d5cd8f371524176c1fc7a55fe7ecc9bb.tar.gz
caelestia-shell-bed6f7c5d5cd8f371524176c1fc7a55fe7ecc9bb.tar.bz2
caelestia-shell-bed6f7c5d5cd8f371524176c1fc7a55fe7ecc9bb.zip
internal: windowinfo pass in client
So it can be used for clients other than the active one Also fix text below screencopyview
Diffstat (limited to 'modules/windowinfo/Buttons.qml')
-rw-r--r--modules/windowinfo/Buttons.qml19
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}`);
}
}
}