18#include <QApplication>
21#include <QStyleFactory>
52 QString lnb =
"LittleFinger";
62 name = path +
"resource.qss";
65 if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
76 stylestring.replace(lnb, fake_dir +
"/" + theme_name +
"/");
78 if (QString(theme_name) == QString(
"System")) {
81 QStyle *fstyle = QStyleFactory::create(
"Fusion");
83 if (fstyle !=
nullptr) {
84 QApplication::setStyle(fstyle);
91 QPixmapCache::clear();
94 gui()->reload_sidebar_icons();
96 pal.setBrush(QPalette::Link, QColor(92,170,229));
97 pal.setBrush(QPalette::LinkVisited, QColor(54,150,229));
98 QApplication::setPalette(pal);
108 log_fatal(
_(
"No Qt-client theme was found. For instructions on how to "
109 "get one, please visit %s"), WIKI_URL);
129 int len = strlen(data_dir) + strlen(
"/themes/gui-qt") + 1;
147 QStringList sl, theme_list;
158 sl << dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
172 if (theme_list.contains(qtheme_name)) {
173 theme_list.removeAll(qtheme_name);
174 theme_list.prepend(qtheme_name);
176 array =
new char *[theme_list.count()];
177 *count = theme_list.count();
179 for (
int i = 0; i < *count; i++) {
182 qba = theme_list[i].toUtf8();
183 data =
new char[theme_list[i].toUtf8().length() + 1];
184 tn_bytes = theme_list[i].toUtf8();
185 strcpy(data, tn_bytes.data());
QApplication * current_app()
#define log_fatal(message,...)
struct client_options gui_options
#define FC_QT_DEFAULT_THEME_NAME
const struct strvec * get_data_dirs(void)
size_t strvec_size(const struct strvec *psv)
#define strvec_iterate(psv, str)
#define strvec_iterate_end
char gui_qt_default_theme_name[512]
int fc_snprintf(char *str, size_t n, const char *format,...)
static QString def_app_style
char ** qtg_get_usable_themes_in_directory(const char *directory, int *count)
void qtg_gui_clear_theme()
static QString stylestring
void qtg_gui_load_theme(const char *directory, const char *theme_name)
char ** qtg_get_gui_specific_themes_directories(int *count)
struct theme_directory * directories