9#include <QtQmlIntegration/qqmlintegration.h>
77 [[nodiscard]] QObject*
runner()
const;
80 [[nodiscard]] QObject*
store()
const;
95 Q_INVOKABLE
void preview(
const QString& wallpaperPath);
97 Q_INVOKABLE
void previewTokens(
const QVariantMap& tokens,
const QString& label);
113 [[nodiscard]]
static bool writePalette(
const QString& path,
const QVariantMap& tokens);
130 void onPaletteReady(
const QVariantMap& tokens,
const QString& wallpaperPath);
131 void onRunnerFailed(
const QString& wallpaperPath,
const QString& reason);
135 void ensureSnapshot();
138 [[nodiscard]]
bool applyToStore(
const QVariantMap& tokens);
139 void setPreviewPath(
const QString& path);
140 void setBusy(
bool busy);
141 void setLastError(
const QString& error);
142 [[nodiscard]] QVariantMap storePalette()
const;
144 QPointer<QObject> m_runner;
145 QPointer<QObject> m_store;
146 QTimer* m_debounce =
nullptr;
147 QString m_persistPath;
148 QString m_pendingPath;
149 QString m_previewPath;
151 QVariantMap m_snapshot;
152 bool m_hasSnapshot =
false;
void previewFailed(const QString &path, const QString &reason)
The runner could not produce a palette for path.
void commit()
Apply: keep what is live (and what a still-pending run lands), forget the snapshot,...
QString persistPath() const
void preview(const QString &wallpaperPath)
Hover a wallpaper candidate: debounced, cancels the previous run.
void setDebounceMs(int ms)
void previewTokens(const QVariantMap &tokens, const QString &label)
Hover a theme tile: its tokens are applied at once under label.
bool isPreviewing() const
void previewPathChanged()
void persistPathChanged()
QString previewPath() const
void setPersistPath(const QString &path)
RetintController(QObject *parent=nullptr)
Where commit() writes the committed palette, in the { "tokens": { ... } } shape PaletteStore reads.
static bool writePalette(const QString &path, const QVariantMap &tokens)
Write tokens to path atomically in the wrapped shape.
~RetintController() override
void previewApplied(const QString &path)
The store now shows path's palette.
static QVariantMap withoutBrandStops(const QVariantMap &tokens)
tokens without the four brand stops. Pure, for the tests.
QString lastError() const
void setRunner(QObject *runner)
void clearPreview()
The pointer left without Apply: put the snapshot back.
void setStore(QObject *store)
static QString defaultPersistPath()
The palette file the shell reads at startup and commit() writes: <AppLocalDataLocation>/palettes/curr...
Definition AppearanceLibrary.h:13