ui: add native reload popup

This commit is contained in:
outfoxxed 2025-05-17 17:03:03 -07:00
parent 5c1d600e84
commit 8124a63ee4
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
13 changed files with 475 additions and 4 deletions

View file

@ -173,6 +173,14 @@ public:
Q_INVOKABLE [[nodiscard]] QString statePath(const QString& path) const;
/// Equivalent to `${Quickshell.cacheDir}/${path}`
Q_INVOKABLE [[nodiscard]] QString cachePath(const QString& path) const;
/// When called from @@reloadCompleted() or @@reloadFailed(), prevents the
/// default reload popup from displaying.
///
/// The popup can also be blocked by setting `QS_NO_RELOAD_POPUP=1`.
Q_INVOKABLE void inhibitReloadPopup() { this->mInhibitReloadPopup = true; }
void clearReloadPopupInhibit() { this->mInhibitReloadPopup = false; }
[[nodiscard]] bool isReloadPopupInhibited() const { return this->mInhibitReloadPopup; }
[[nodiscard]] QString shellRoot() const;
@ -212,6 +220,8 @@ private slots:
private:
QuickshellGlobal(QObject* parent = nullptr);
bool mInhibitReloadPopup = false;
static qsizetype screensCount(QQmlListProperty<QuickshellScreenInfo>* prop);
static QuickshellScreenInfo* screenAt(QQmlListProperty<QuickshellScreenInfo>* prop, qsizetype i);
};