forked from quickshell/quickshell
		
	feat(wayland): WaylandLayershell attached property for PanelWindow
This commit is contained in:
		
							parent
							
								
									13c5d7c7a9
								
							
						
					
					
						commit
						e2063e8b93
					
				
					 2 changed files with 13 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue