-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy paththememanager.h
More file actions
41 lines (31 loc) · 1.24 KB
/
thememanager.h
File metadata and controls
41 lines (31 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (c) 2023 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_QML_THEMEMANAGER_H
#define BITCOIN_QML_THEMEMANAGER_H
#include <QObject>
#include <QColor>
#include <QProcess>
class ThemeManager : public QObject
{
Q_OBJECT
Q_PROPERTY(bool darkMode READ darkMode NOTIFY darkModeChanged)
Q_PROPERTY(QColor systemBaseColor READ systemBaseColor WRITE setSystemBaseColor)
Q_PROPERTY(bool systemThemeAvailable READ systemThemeAvailable WRITE setSystemThemeAvailable NOTIFY systemThemeAvailableChanged)
public:
explicit ThemeManager(QObject* parent = nullptr);
bool darkMode() const { return m_dark_mode; };
QColor systemBaseColor() const { return m_system_base_color; };
bool systemThemeAvailable() const { return m_system_theme_available; };
public Q_SLOTS:
void setSystemBaseColor(QColor base_color);
void setSystemThemeAvailable(bool available);
Q_SIGNALS:
void darkModeChanged();
void systemThemeAvailableChanged();
private:
bool m_dark_mode{ true };
QColor m_system_base_color;
bool m_system_theme_available{ false };
};
#endif // BITCOIN_QML_THEMEMANAGER_H