forked from quickshell/quickshell
feat(wayland): WaylandLayershell attached property for PanelWindow
This commit is contained in:
parent
13c5d7c7a9
commit
e2063e8b93
|
@ -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::WaylandPanelInterface(QObject* parent)
|
WaylandPanelInterface::WaylandPanelInterface(QObject* parent)
|
||||||
|
|
|
@ -26,6 +26,7 @@ class WaylandLayershell: public ProxyWindowBase {
|
||||||
Q_PROPERTY(qint32 exclusiveZone READ exclusiveZone WRITE setExclusiveZone NOTIFY exclusiveZoneChanged);
|
Q_PROPERTY(qint32 exclusiveZone READ exclusiveZone WRITE setExclusiveZone NOTIFY exclusiveZoneChanged);
|
||||||
Q_PROPERTY(ExclusionMode::Enum exclusionMode READ exclusionMode WRITE setExclusionMode NOTIFY exclusionModeChanged);
|
Q_PROPERTY(ExclusionMode::Enum exclusionMode READ exclusionMode WRITE setExclusionMode NOTIFY exclusionModeChanged);
|
||||||
Q_PROPERTY(Margins margins READ margins WRITE setMargins NOTIFY marginsChanged);
|
Q_PROPERTY(Margins margins READ margins WRITE setMargins NOTIFY marginsChanged);
|
||||||
|
QML_ATTACHED(WaylandLayershell);
|
||||||
QML_ELEMENT;
|
QML_ELEMENT;
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
@ -61,6 +62,8 @@ public:
|
||||||
[[nodiscard]] Margins margins() const;
|
[[nodiscard]] Margins margins() const;
|
||||||
void setMargins(Margins margins); // NOLINT
|
void setMargins(Margins margins); // NOLINT
|
||||||
|
|
||||||
|
static WaylandLayershell* qmlAttachedProperties(QObject* object);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void layerChanged();
|
void layerChanged();
|
||||||
void namespaceChanged();
|
void namespaceChanged();
|
||||||
|
@ -131,4 +134,6 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WaylandLayershell* layer;
|
WaylandLayershell* layer;
|
||||||
|
|
||||||
|
friend class WaylandLayershell;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue