hyprland/ipc: make monitor bindable + fix property errors

This commit is contained in:
outfoxxed 2025-03-26 14:19:50 -07:00
parent 62ccab5d30
commit 8f11d60999
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
3 changed files with 35 additions and 35 deletions

View file

@ -9,10 +9,11 @@
#include <qtypes.h>
#include "connection.hpp"
#include "workspace.hpp"
namespace qs::hyprland::ipc {
class HyprlandWorkspace;
class HyprlandMonitor: public QObject {
Q_OBJECT;
// clang-format off
@ -31,9 +32,9 @@ class HyprlandMonitor: public QObject {
/// > property, run @@Hyprland.refreshMonitors() and wait for this property to update.
Q_PROPERTY(QVariantMap lastIpcObject READ lastIpcObject NOTIFY lastIpcObjectChanged);
/// The currently active workspace on this monitor. May be null.
Q_PROPERTY(qs::hyprland::ipc::HyprlandWorkspace* activeWorkspace READ default NOTIFY activeWorkspaceChanged);
Q_PROPERTY(qs::hyprland::ipc::HyprlandWorkspace* activeWorkspace READ default NOTIFY activeWorkspaceChanged BINDABLE bindableActiveWorkspace);
/// If the monitor is currently focused.
Q_PROPERTY(bool focused READ default NOTIFY focusedChanged);
Q_PROPERTY(bool focused READ default NOTIFY focusedChanged BINDABLE bindableFocused);
// clang-format on
QML_ELEMENT;
QML_UNCREATABLE("HyprlandMonitors must be retrieved from the HyprlandIpc object.");