lidwatcher plugin initial setup

This commit is contained in:
2026-06-01 20:02:37 +02:00
parent 82aa7c415f
commit 7de8cc3104
4 changed files with 92 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
#pragma once
#include <QObject>
#include <qqmlintegration.h>
namespace ZShell {
class LidWatcher : public QObject {
Q_OBJECT
QML_ELEMENT
QML_SINGLETON
Q_PROPERTY(bool available READ available NOTIFY availableChanged)
public:
explicit LidWatcher(QObject* parent = nullptr);
[[nodiscard]] bool available() const;
private Q_SLOTS:
void onPrepareForSleep(bool goingDown);
Q_SIGNALS:
void availableChanged();
void lidClosing();
void lidOpened();
private:
bool m_available;
};
} // namespace ZShell