Debian Codegraph @

src/ui/Theme.h

raw symbols SCIP
1 // SPDX-FileCopyrightText: Nheko Contributors
2 //
3 // SPDX-License-Identifier: GPL-3.0-or-later
4
5 #pragma once
6
7 #include <QColor>
8 #include <QPalette>
9 #include <QQmlEngine>
10
11 class Theme final : public QPalette
12 {
13 Q_GADGET
14 QML_ANONYMOUS
15
16 Q_PROPERTY(QColor sidebarBackground READ sidebarBackground CONSTANT)
17 Q_PROPERTY(QColor alternateButton READ alternateButton CONSTANT)
18 Q_PROPERTY(QColor separator READ separator CONSTANT)
19 Q_PROPERTY(QColor red READ red CONSTANT)
20 Q_PROPERTY(QColor green READ green CONSTANT)
21 Q_PROPERTY(QColor error READ error CONSTANT)
22 Q_PROPERTY(QColor orange READ orange CONSTANT)
23 Q_PROPERTY(QColor online READ online CONSTANT)
24 Q_PROPERTY(QColor unavailable READ unavailable CONSTANT)
25 public:
26 Theme() {}
27 explicit Theme(QStringView theme);
28 static QPalette paletteFromTheme(QStringView theme);
29
30 QColor sidebarBackground() const { return sidebarBackground_; }
31 QColor alternateButton() const { return alternateButton_; }
32 QColor separator() const { return separator_; }
33 QColor red() const { return red_; }
34 QColor green() const { return green_; }
35 QColor error() const { return error_; }
36 QColor orange() const { return orange_; }
37 QColor online() const { return QColor(0x00, 0xcc, 0x66); }
38 QColor unavailable() const { return QColor(0xff, 0x99, 0x33); }
39
40 private:
41 QColor sidebarBackground_, separator_, red_, green_, error_, orange_, alternateButton_;
42 };