Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
AppearanceWatcher.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3#pragma once
4
5#include <PhosphorTheme/phosphortheme_export.h>
6#include <QFileSystemWatcher>
7#include <QObject>
8#include <QTimer>
9#include <QVariantMap>
10
11namespace PhosphorTheme {
12
13// The cross-process view of saved appearance or its live, locked preview.
14// Native decorations, the compositor, and application adapters share this
15// reader so an orphaned preview cannot become a permanent desktop style.
16// `appearancePath` is the file the producing app's AppearanceStore writes.
17class PHOSPHORTHEME_EXPORT AppearanceWatcher : public QObject
18{
19 Q_OBJECT
20public:
21 explicit AppearanceWatcher(const QString& appearancePath, QObject* parent = nullptr);
22 QVariantMap values() const
23 {
24 return m_values;
25 }
26
27Q_SIGNALS:
28 void changed();
29
30private:
31 void reload();
32 void watchPaths();
33 QString m_appearancePath;
34 QVariantMap m_values;
35 QFileSystemWatcher m_watcher;
36 QTimer m_reload;
37 QTimer m_previewPoll;
38};
39
40}
QVariantMap values() const
Definition AppearanceWatcher.h:22
AppearanceWatcher(const QString &appearancePath, QObject *parent=nullptr)
Definition AppearanceLibrary.h:10