summaryrefslogtreecommitdiff
path: root/modules/windowinfo/Preview.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/Preview.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/Preview.qml')
-rw-r--r--modules/windowinfo/Preview.qml14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/windowinfo/Preview.qml b/modules/windowinfo/Preview.qml
index 2619e8a..094a999 100644
--- a/modules/windowinfo/Preview.qml
+++ b/modules/windowinfo/Preview.qml
@@ -4,9 +4,8 @@ import "root:/widgets"
import "root:/services"
import "root:/config"
import Quickshell
-import Quickshell.Io
import Quickshell.Wayland
-import Quickshell.Widgets
+import Quickshell.Hyprland
import QtQuick
import QtQuick.Layouts
@@ -14,6 +13,7 @@ Item {
id: root
required property ShellScreen screen
+ required property HyprlandToplevel client
Layout.preferredWidth: preview.implicitWidth + Appearance.padding.large * 2
Layout.fillHeight: true
@@ -34,7 +34,7 @@ Item {
Loader {
anchors.centerIn: parent
- active: !Hyprland.activeToplevel
+ active: !root.client
asynchronous: true
sourceComponent: ColumnLayout {
@@ -69,10 +69,10 @@ Item {
anchors.centerIn: parent
- captureSource: Hyprland.activeToplevel?.wayland ?? null
+ captureSource: root.client?.wayland ?? null
live: true
- constraintSize.width: parent.height * Math.min(root.screen.width / root.screen.height, Hyprland.activeToplevel?.lastIpcObject.size[0] / Hyprland.activeToplevel?.lastIpcObject.size[1])
+ constraintSize.width: parent.height * Math.min(root.screen.width / root.screen.height, root.client?.lastIpcObject.size[0] / root.client?.lastIpcObject.size[1])
constraintSize.height: parent.height
}
}
@@ -86,12 +86,12 @@ Item {
animate: true
text: {
- const client = Hyprland.activeToplevel;
+ const client = root.client;
if (!client)
return qsTr("No active client");
const mon = client.monitor;
- return qsTr("%1 on monitor %2 at %3, %4").arg(client.title).arg(mon.name).arg(client.x).arg(client.y);
+ return qsTr("%1 on monitor %2 at %3, %4").arg(client.title).arg(mon.name).arg(client.lastIpcObject.at[0]).arg(client.lastIpcObject.at[1]);
}
}
}