mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
parent
42a23e1859
commit
09babc91d2
3 changed files with 11 additions and 7 deletions
|
@ -79,9 +79,9 @@ AbstractButton {
|
||||||
function updatePresence() {
|
function updatePresence() {
|
||||||
switch (Presence.userPresence(userid)) {
|
switch (Presence.userPresence(userid)) {
|
||||||
case "online":
|
case "online":
|
||||||
return Nheko.theme.green;
|
return Nheko.theme.online;
|
||||||
case "unavailable":
|
case "unavailable":
|
||||||
return Nheko.theme.red;
|
return Nheko.theme.unavailable;
|
||||||
case "offline":
|
case "offline":
|
||||||
default:
|
default:
|
||||||
// return "#a82353" don't show anything if offline, since it is confusing, if presence is disabled
|
// return "#a82353" don't show anything if offline, since it is confusing, if presence is disabled
|
||||||
|
|
|
@ -69,22 +69,22 @@ Theme::Theme(QStringView theme)
|
||||||
sidebarBackground_ = QColor(0x23, 0x36, 0x49);
|
sidebarBackground_ = QColor(0x23, 0x36, 0x49);
|
||||||
alternateButton_ = QColor(0xcc, 0xcc, 0xcc);
|
alternateButton_ = QColor(0xcc, 0xcc, 0xcc);
|
||||||
red_ = QColor(0xa8, 0x23, 0x53);
|
red_ = QColor(0xa8, 0x23, 0x53);
|
||||||
green_ = QColor(Qt::GlobalColor::green);
|
green_ = QColor(QColorConstants::Svg::green);
|
||||||
orange_ = QColor(0xfc, 0xbe, 0x05);
|
orange_ = QColor(0xfc, 0xbe, 0x05);
|
||||||
error_ = QColor(0xdd, 0x3d, 0x3d);
|
error_ = QColor(0xdd, 0x3d, 0x3d);
|
||||||
} else if (theme == u"dark") {
|
} else if (theme == u"dark") {
|
||||||
sidebarBackground_ = QColor(0x2d, 0x31, 0x39);
|
sidebarBackground_ = QColor(0x2d, 0x31, 0x39);
|
||||||
alternateButton_ = QColor(0x41, 0x4A, 0x59);
|
alternateButton_ = QColor(0x41, 0x4A, 0x59);
|
||||||
red_ = QColor(0xa8, 0x23, 0x53);
|
red_ = QColor(0xa8, 0x23, 0x53);
|
||||||
green_ = QColor(Qt::GlobalColor::green);
|
green_ = QColor(QColorConstants::Svg::green);
|
||||||
orange_ = QColor(0xfc, 0xc5, 0x3a);
|
orange_ = QColor(0xfc, 0xc5, 0x3a);
|
||||||
error_ = QColor(0xdd, 0x3d, 0x3d);
|
error_ = QColor(0xdd, 0x3d, 0x3d);
|
||||||
} else {
|
} else {
|
||||||
sidebarBackground_ = p.window().color();
|
sidebarBackground_ = p.window().color();
|
||||||
alternateButton_ = p.dark().color();
|
alternateButton_ = p.dark().color();
|
||||||
red_ = QColor(Qt::GlobalColor::red);
|
red_ = QColor(QColorConstants::Svg::red);
|
||||||
green_ = QColor(Qt::GlobalColor::green);
|
green_ = QColor(QColorConstants::Svg::green);
|
||||||
orange_ = QColor(0xff, 0xa5, 0x00); // SVG orange
|
orange_ = QColor(QColorConstants::Svg::orange); // SVG orange
|
||||||
error_ = QColor(0xdd, 0x3d, 0x3d);
|
error_ = QColor(0xdd, 0x3d, 0x3d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,8 @@ class Theme : public QPalette
|
||||||
Q_PROPERTY(QColor green READ green CONSTANT)
|
Q_PROPERTY(QColor green READ green CONSTANT)
|
||||||
Q_PROPERTY(QColor error READ error CONSTANT)
|
Q_PROPERTY(QColor error READ error CONSTANT)
|
||||||
Q_PROPERTY(QColor orange READ orange CONSTANT)
|
Q_PROPERTY(QColor orange READ orange CONSTANT)
|
||||||
|
Q_PROPERTY(QColor online READ online CONSTANT)
|
||||||
|
Q_PROPERTY(QColor unavailable READ unavailable CONSTANT)
|
||||||
public:
|
public:
|
||||||
Theme() {}
|
Theme() {}
|
||||||
explicit Theme(QStringView theme);
|
explicit Theme(QStringView theme);
|
||||||
|
@ -30,6 +32,8 @@ public:
|
||||||
QColor green() const { return green_; }
|
QColor green() const { return green_; }
|
||||||
QColor error() const { return error_; }
|
QColor error() const { return error_; }
|
||||||
QColor orange() const { return orange_; }
|
QColor orange() const { return orange_; }
|
||||||
|
QColor online() const { return QColor(0x00, 0xcc, 0x66); }
|
||||||
|
QColor unavailable() const { return QColor(0xff, 0x99, 0x33); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QColor sidebarBackground_, separator_, red_, green_, error_, orange_, alternateButton_;
|
QColor sidebarBackground_, separator_, red_, green_, error_, orange_, alternateButton_;
|
||||||
|
|
Loading…
Reference in a new issue