feat(wayland): WaylandLayershell attached property for PanelWindow

This commit is contained in:
outfoxxed 2024-02-25 18:25:48 -08:00
parent 13c5d7c7a9
commit e2063e8b93
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
2 changed files with 13 additions and 0 deletions

View file

@ -150,6 +150,14 @@ void WaylandLayershell::updateAutoExclusion() {
}
}
WaylandLayershell* WaylandLayershell::qmlAttachedProperties(QObject* object) {
if (auto* obj = qobject_cast<WaylandPanelInterface*>(object)) {
return obj->layer;
} else {
return nullptr;
}
}
// WaylandPanelInterface
WaylandPanelInterface::WaylandPanelInterface(QObject* parent)

View file

@ -26,6 +26,7 @@ class WaylandLayershell: public ProxyWindowBase {
Q_PROPERTY(qint32 exclusiveZone READ exclusiveZone WRITE setExclusiveZone NOTIFY exclusiveZoneChanged);
Q_PROPERTY(ExclusionMode::Enum exclusionMode READ exclusionMode WRITE setExclusionMode NOTIFY exclusionModeChanged);
Q_PROPERTY(Margins margins READ margins WRITE setMargins NOTIFY marginsChanged);
QML_ATTACHED(WaylandLayershell);
QML_ELEMENT;
// clang-format on
@ -61,6 +62,8 @@ public:
[[nodiscard]] Margins margins() const;
void setMargins(Margins margins); // NOLINT
static WaylandLayershell* qmlAttachedProperties(QObject* object);
signals:
void layerChanged();
void namespaceChanged();
@ -131,4 +134,6 @@ public:
private:
WaylandLayershell* layer;
friend class WaylandLayershell;
};