forked from quickshell/quickshell
feat: add layershell support
This commit is contained in:
parent
56502b79f6
commit
d76100781f
12 changed files with 677 additions and 11 deletions
34
src/cpp/qmlglobal.hpp
Normal file
34
src/cpp/qmlglobal.hpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
#pragma once
|
||||
|
||||
#include <qcontainerfwd.h>
|
||||
#include <qobject.h>
|
||||
#include <qqmlintegration.h>
|
||||
#include <qqmllist.h>
|
||||
#include <qtmetamacros.h>
|
||||
#include <qtypes.h>
|
||||
|
||||
#include "qmlscreen.hpp"
|
||||
|
||||
class QtShellGlobal: public QObject {
|
||||
Q_OBJECT;
|
||||
Q_PROPERTY(QQmlListProperty<QtShellScreenInfo> screens READ screens NOTIFY screensChanged);
|
||||
QML_SINGLETON;
|
||||
QML_ELEMENT;
|
||||
|
||||
public:
|
||||
QtShellGlobal(QObject* parent = nullptr);
|
||||
|
||||
QQmlListProperty<QtShellScreenInfo> screens();
|
||||
|
||||
signals:
|
||||
void screensChanged();
|
||||
|
||||
public slots:
|
||||
void updateScreens();
|
||||
|
||||
private:
|
||||
static qsizetype screensCount(QQmlListProperty<QtShellScreenInfo>* prop);
|
||||
static QtShellScreenInfo* screenAt(QQmlListProperty<QtShellScreenInfo>* prop, qsizetype i);
|
||||
|
||||
QVector<QtShellScreenInfo*> mScreens;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue