diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-21 22:47:13 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-21 22:47:13 +1000 |
| commit | 4a86b66d06dda958f8d136234225ed160604a61a (patch) | |
| tree | 8dab0f695e035f26dccc2089ee4636c2b7b7ee2a /modules/windowinfo/Preview.qml | |
| parent | popouts: convert to layout (diff) | |
| download | caelestia-shell-4a86b66d06dda958f8d136234225ed160604a61a.tar.gz caelestia-shell-4a86b66d06dda958f8d136234225ed160604a61a.tar.bz2 caelestia-shell-4a86b66d06dda958f8d136234225ed160604a61a.zip | |
feat: window info panel
Also disable reload popup
Diffstat (limited to 'modules/windowinfo/Preview.qml')
| -rw-r--r-- | modules/windowinfo/Preview.qml | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/modules/windowinfo/Preview.qml b/modules/windowinfo/Preview.qml new file mode 100644 index 0000000..26941db --- /dev/null +++ b/modules/windowinfo/Preview.qml @@ -0,0 +1,65 @@ +pragma ComponentBehavior: Bound + +import "root:/widgets" +import "root:/services" +import "root:/config" +import Quickshell +import Quickshell.Io +import Quickshell.Wayland +import Quickshell.Widgets +import QtQuick +import QtQuick.Layouts + +Item { + id: root + + required property ShellScreen screen + + Layout.preferredWidth: preview.implicitWidth + Appearance.padding.large * 2 + Layout.fillHeight: true + + ClippingRectangle { + id: preview + + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.bottom: label.top + anchors.topMargin: Appearance.padding.large + anchors.bottomMargin: Appearance.spacing.normal + + implicitWidth: view.implicitWidth + + color: "transparent" + radius: Appearance.rounding.small + + ScreencopyView { + id: view + + anchors.centerIn: parent + + captureSource: Hyprland.activeClient ? ToplevelManager.activeToplevel : null + live: true + + constraintSize.width: parent.height * Math.min(screen.width / screen.height, Hyprland.activeClient.width / Hyprland.activeClient.height) + constraintSize.height: parent.height + } + } + + StyledText { + id: label + + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + anchors.bottomMargin: Appearance.padding.large + + animate: true + text: { + const client = Hyprland.activeClient; + if (!client) + return qsTr("No active client"); + + const mon = Hyprland.monitors.values[Hyprland.activeClient.lastIpcObject.monitor]; + return qsTr("%1 on monitor %2 at %3, %4").arg(client.title).arg(mon.name).arg(client.x).arg(client.y); + } + } +} |