Use better icons for RSS articles (#20587)
[qBittorrent.git] / src / gui / uithemecommon.h
blob59a78738bc7997474e54612a63f31afc733d6c78
1 /*
2 * Bittorrent Client using Qt and libtorrent.
3 * Copyright (C) 2023 Vladimir Golovnev <glassez@yandex.ru>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
18 * USA.
20 * In addition, as a special exception, the copyright holders give permission to
21 * link this program with the OpenSSL project's "OpenSSL" library (or with
22 * modified versions of it that use the same license as the "OpenSSL" library),
23 * and distribute the linked executables. You must obey the GNU General Public
24 * License in all respects for all of the code used other than "OpenSSL". If
25 * you modify file(s), you may extend this exception to your version of the
26 * file(s), but you are not obligated to do so. If you do not wish to do so,
27 * delete this exception statement from your version.
30 #pragma once
32 #include <QApplication>
33 #include <QColor>
34 #include <QHash>
35 #include <QPalette>
36 #include <QSet>
37 #include <QString>
39 #include "base/global.h"
40 #include "color.h"
42 inline const QString CONFIG_FILE_NAME = u"config.json"_s;
43 inline const QString STYLESHEET_FILE_NAME = u"stylesheet.qss"_s;
44 inline const QString KEY_COLORS = u"colors"_s;
45 inline const QString KEY_COLORS_LIGHT = u"colors.light"_s;
46 inline const QString KEY_COLORS_DARK = u"colors.dark"_s;
48 struct UIThemeColor
50 QColor light;
51 QColor dark;
54 inline QHash<QString, UIThemeColor> defaultUIThemeColors()
56 const QPalette palette = QApplication::palette();
57 return {
58 {u"Log.TimeStamp"_s, {Color::Primer::Light::fgSubtle, Color::Primer::Dark::fgSubtle}},
59 {u"Log.Normal"_s, {palette.color(QPalette::Active, QPalette::WindowText), palette.color(QPalette::Active, QPalette::WindowText)}},
60 {u"Log.Info"_s, {Color::Primer::Light::accentFg, Color::Primer::Dark::accentFg}},
61 {u"Log.Warning"_s, {Color::Primer::Light::severeFg, Color::Primer::Dark::severeFg}},
62 {u"Log.Critical"_s, {Color::Primer::Light::dangerFg, Color::Primer::Dark::dangerFg}},
63 {u"Log.BannedPeer"_s, {Color::Primer::Light::dangerFg, Color::Primer::Dark::dangerFg}},
65 {u"RSS.ReadArticle"_s, {palette.color(QPalette::Inactive, QPalette::WindowText), palette.color(QPalette::Inactive, QPalette::WindowText)}},
66 {u"RSS.UnreadArticle"_s, {palette.color(QPalette::Active, QPalette::Link), palette.color(QPalette::Active, QPalette::Link)}},
68 {u"TransferList.Downloading"_s, {Color::Primer::Light::successFg, Color::Primer::Dark::successFg}},
69 {u"TransferList.StalledDownloading"_s, {Color::Primer::Light::successEmphasis, Color::Primer::Dark::successEmphasis}},
70 {u"TransferList.DownloadingMetadata"_s, {Color::Primer::Light::successFg, Color::Primer::Dark::successFg}},
71 {u"TransferList.ForcedDownloadingMetadata"_s, {Color::Primer::Light::successFg, Color::Primer::Dark::successFg}},
72 {u"TransferList.ForcedDownloading"_s, {Color::Primer::Light::successFg, Color::Primer::Dark::successFg}},
73 {u"TransferList.Uploading"_s, {Color::Primer::Light::accentFg, Color::Primer::Dark::accentFg}},
74 {u"TransferList.StalledUploading"_s, {Color::Primer::Light::accentEmphasis, Color::Primer::Dark::accentEmphasis}},
75 {u"TransferList.ForcedUploading"_s, {Color::Primer::Light::accentFg, Color::Primer::Dark::accentFg}},
76 {u"TransferList.QueuedDownloading"_s, {Color::Primer::Light::scaleYellow6, Color::Primer::Dark::scaleYellow6}},
77 {u"TransferList.QueuedUploading"_s, {Color::Primer::Light::scaleYellow6, Color::Primer::Dark::scaleYellow6}},
78 {u"TransferList.CheckingDownloading"_s, {Color::Primer::Light::successFg, Color::Primer::Dark::successFg}},
79 {u"TransferList.CheckingUploading"_s, {Color::Primer::Light::successFg, Color::Primer::Dark::successFg}},
80 {u"TransferList.CheckingResumeData"_s, {Color::Primer::Light::successFg, Color::Primer::Dark::successFg}},
81 {u"TransferList.PausedDownloading"_s, {Color::Primer::Light::fgMuted, Color::Primer::Dark::fgMuted}},
82 {u"TransferList.PausedUploading"_s, {Color::Primer::Light::doneFg, Color::Primer::Dark::doneFg}},
83 {u"TransferList.Moving"_s, {Color::Primer::Light::successFg, Color::Primer::Dark::successFg}},
84 {u"TransferList.MissingFiles"_s, {Color::Primer::Light::dangerFg, Color::Primer::Dark::dangerFg}},
85 {u"TransferList.Error"_s, {Color::Primer::Light::dangerFg, Color::Primer::Dark::dangerFg}}
89 inline QSet<QString> defaultUIThemeIcons()
91 return {
92 u"application-exit"_s,
93 u"application-rss"_s,
94 u"application-url"_s,
95 u"browser-cookies"_s,
96 u"chart-line"_s,
97 u"checked-completed"_s,
98 u"configure"_s,
99 u"connected"_s,
100 u"dialog-warning"_s,
101 u"directory"_s,
102 u"disconnected"_s,
103 u"download"_s,
104 u"downloading"_s,
105 u"edit-clear"_s,
106 u"edit-copy"_s,
107 u"edit-find"_s,
108 u"edit-rename"_s,
109 u"error"_s,
110 u"fileicon"_s,
111 u"filter-active"_s,
112 u"filter-all"_s,
113 u"filter-inactive"_s,
114 u"filter-stalled"_s,
115 u"firewalled"_s,
116 u"folder-documents"_s,
117 u"folder-new"_s,
118 u"folder-remote"_s,
119 u"force-recheck"_s,
120 u"go-bottom"_s,
121 u"go-down"_s,
122 u"go-top"_s,
123 u"go-up"_s,
124 u"hash"_s,
125 u"help-about"_s,
126 u"help-contents"_s,
127 u"insert-link"_s,
128 u"ip-blocked"_s,
129 u"list-add"_s,
130 u"list-remove"_s,
131 u"loading"_s,
132 u"mail-inbox"_s,
133 u"name"_s,
134 u"network-connect"_s,
135 u"network-server"_s,
136 u"object-locked"_s,
137 u"peers"_s,
138 u"peers-add"_s,
139 u"peers-remove"_s,
140 u"plugins"_s,
141 u"preferences-advanced"_s,
142 u"preferences-bittorrent"_s,
143 u"preferences-desktop"_s,
144 u"preferences-webui"_s,
145 u"qbittorrent-tray"_s,
146 u"qbittorrent-tray-dark"_s,
147 u"qbittorrent-tray-light"_s,
148 u"queued"_s,
149 u"ratio"_s,
150 u"reannounce"_s,
151 u"rss_read_article"_s,
152 u"rss_unread_article"_s,
153 u"security-high"_s,
154 u"security-low"_s,
155 u"set-location"_s,
156 u"slow"_s,
157 u"slow_off"_s,
158 u"speedometer"_s,
159 u"stalledDL"_s,
160 u"stalledUP"_s,
161 u"stopped"_s,
162 u"system-log-out"_s,
163 u"tags"_s,
164 u"task-complete"_s,
165 u"task-reject"_s,
166 u"torrent-creator"_s,
167 u"torrent-magnet"_s,
168 u"torrent-start"_s,
169 u"torrent-start-forced"_s,
170 u"torrent-stop"_s,
171 u"tracker-error"_s,
172 u"tracker-warning"_s,
173 u"trackerless"_s,
174 u"trackers"_s,
175 u"upload"_s,
176 u"view-categories"_s,
177 u"view-preview"_s,
178 u"view-refresh"_s,
179 u"view-statistics"_s,
180 u"wallet-open"_s