Make comic flow themable

This commit is contained in:
luisangelsm
2026-01-20 11:23:42 +01:00
parent 1bd4926b25
commit b662e4975b
2 changed files with 28 additions and 1 deletions

View File

@ -89,6 +89,11 @@ struct ComicVineThemeTemplates {
QSize rowIconSize = QSize(8, 7); QSize rowIconSize = QSize(8, 7);
}; };
struct ComicFlowColors {
QColor backgroundColor;
QColor textColor;
};
struct ComicVineTheme { struct ComicVineTheme {
QString defaultLabelQSS; QString defaultLabelQSS;
QString titleLabelQSS; QString titleLabelQSS;
@ -123,6 +128,7 @@ struct ComicVineTheme {
}; };
struct Theme { struct Theme {
ComicFlowColors comicFlow;
ComicVineTheme comicVine; ComicVineTheme comicVine;
}; };

View File

@ -3,7 +3,6 @@
#include "icon_utils.h" #include "icon_utils.h"
struct ComicVineParams { struct ComicVineParams {
ComicVineThemeTemplates t; ComicVineThemeTemplates t;
QColor contentTextColor; QColor contentTextColor;
@ -53,6 +52,7 @@ struct ComicVineParams {
struct ThemeParams { struct ThemeParams {
QString themeName; QString themeName;
ComicFlowColors comicFlowColors;
ComicVineParams comicVineParams; ComicVineParams comicVineParams;
}; };
@ -60,6 +60,12 @@ Theme makeTheme(const ThemeParams &params)
{ {
Theme theme; Theme theme;
// Comic Flow
const auto &cf = params.comicFlowColors;
theme.comicFlow.backgroundColor = cf.backgroundColor;
theme.comicFlow.textColor = cf.textColor;
// Comic Vine
const auto &cv = params.comicVineParams; const auto &cv = params.comicVineParams;
const auto &t = cv.t; const auto &t = cv.t;
@ -135,6 +141,10 @@ ThemeParams classicThemeParams()
ThemeParams params; ThemeParams params;
params.themeName = "classic"; params.themeName = "classic";
ComicFlowColors cf;
cf.backgroundColor = Qt::black;
cf.textColor = QColor(0x4C4C4C);
ComicVineParams cv; ComicVineParams cv;
cv.contentTextColor = Qt::white; cv.contentTextColor = Qt::white;
cv.contentBackgroundColor = QColor(0x2B2B2B); cv.contentBackgroundColor = QColor(0x2B2B2B);
@ -181,6 +191,7 @@ ThemeParams classicThemeParams()
cv.t = ComicVineThemeTemplates(); cv.t = ComicVineThemeTemplates();
params.comicFlowColors = cf;
params.comicVineParams = cv; params.comicVineParams = cv;
return params; return params;
@ -191,6 +202,10 @@ ThemeParams lightThemeParams()
ThemeParams params; ThemeParams params;
params.themeName = "light"; params.themeName = "light";
ComicFlowColors cf;
cf.backgroundColor = Qt::white;
cf.textColor = Qt::black;
ComicVineParams cv; ComicVineParams cv;
cv.contentTextColor = Qt::black; cv.contentTextColor = Qt::black;
cv.contentBackgroundColor = QColor(0xECECEC); cv.contentBackgroundColor = QColor(0xECECEC);
@ -237,6 +252,7 @@ ThemeParams lightThemeParams()
cv.t = ComicVineThemeTemplates(); cv.t = ComicVineThemeTemplates();
params.comicFlowColors = cf;
params.comicVineParams = cv; params.comicVineParams = cv;
return params; return params;
@ -247,6 +263,10 @@ ThemeParams darkThemeParams()
ThemeParams params; ThemeParams params;
params.themeName = "dark"; params.themeName = "dark";
ComicFlowColors cf;
cf.backgroundColor = QColor(0x111111);
cf.textColor = QColor(0x888888);
ComicVineParams cv; ComicVineParams cv;
cv.contentTextColor = Qt::white; cv.contentTextColor = Qt::white;
cv.contentBackgroundColor = QColor(0x2B2B2B); cv.contentBackgroundColor = QColor(0x2B2B2B);
@ -293,6 +313,7 @@ ThemeParams darkThemeParams()
cv.t = ComicVineThemeTemplates(); cv.t = ComicVineThemeTemplates();
params.comicFlowColors = cf;
params.comicVineParams = cv; params.comicVineParams = cv;
return params; return params;