forked from quickshell/quickshell
ui: add native reload popup
This commit is contained in:
parent
5c1d600e84
commit
8124a63ee4
13 changed files with 475 additions and 4 deletions
39
src/ui/reload_popup.hpp
Normal file
39
src/ui/reload_popup.hpp
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#pragma once
|
||||
|
||||
#include <qcontainerfwd.h>
|
||||
#include <qobject.h>
|
||||
#include <qqmlengine.h>
|
||||
#include <qqmlintegration.h>
|
||||
#include <qtmetamacros.h>
|
||||
|
||||
#include "../core/generation.hpp"
|
||||
|
||||
namespace qs::ui {
|
||||
|
||||
class ReloadPopup: public QObject {
|
||||
Q_OBJECT;
|
||||
QML_NAMED_ELEMENT(ReloadPopupInfo);
|
||||
QML_UNCREATABLE("")
|
||||
Q_PROPERTY(QString instanceId MEMBER instanceId CONSTANT);
|
||||
Q_PROPERTY(bool failed MEMBER failed CONSTANT);
|
||||
Q_PROPERTY(QString errorString MEMBER errorString CONSTANT);
|
||||
|
||||
public:
|
||||
Q_INVOKABLE void closed();
|
||||
|
||||
static void spawnPopup(QString instanceId, bool failed, QString errorString);
|
||||
|
||||
private:
|
||||
ReloadPopup(QString instanceId, bool failed, QString errorString);
|
||||
|
||||
EngineGeneration* generation;
|
||||
QObject* popup = nullptr;
|
||||
QString instanceId;
|
||||
bool failed = false;
|
||||
bool deleting = false;
|
||||
QString errorString;
|
||||
|
||||
static ReloadPopup* activePopup;
|
||||
};
|
||||
|
||||
} // namespace qs::ui
|
||||
Loading…
Add table
Add a link
Reference in a new issue