Add toolbar and background theming to YACReader

This commit is contained in:
luisangelsm
2026-01-14 15:51:32 +01:00
parent b46f34adb1
commit 721da42c8c
20 changed files with 482 additions and 37 deletions

View File

@ -1,6 +1,7 @@
#include "theme_manager.h"
#include "theme.h"
#include "theme_factory.h"
#include <QGuiApplication>
#include <QStyleHints>
@ -46,5 +47,5 @@ void ThemeManager::setTheme(ThemeId themeId)
void ThemeManager::updateCurrentTheme()
{
// TODO
currentTheme = makeTheme(themeId);
}

View File

@ -32,7 +32,7 @@ QIcon YACReader::noHighlightedIcon(const QString &path)
return icon;
}
void YACReader::colorize(QImage &img, QColor &col)
void YACReader::colorize(QImage &img, const QColor &col)
{
QRgb *data = (QRgb *)img.bits();
QRgb *end = data + img.width() * img.height();
@ -94,6 +94,9 @@ QAction *YACReader::actionWithCustomIcon(const QIcon &icon, QAction *action)
QObject::connect(a, &QAction::toggled, action, &QAction::setChecked);
QObject::connect(action, &QAction::toggled, a, &QAction::setChecked);
// asign a to action somehow so we can retrieve it later
action->setProperty("customIconAction", QVariant::fromValue<QObject *>(a));
return a;
}

View File

@ -24,7 +24,7 @@
#define DOUBLE_PAGE "DOUBLE_PAGE"
#define DOUBLE_MANGA_PAGE "DOUBLE_MANGA_PAGE"
#define COVER_IS_SP "COVER_IS_SP"
#define BACKGROUND_COLOR "BACKGROUND_COLOR"
#define BACKGROUND_COLOR "BACKGROUND_COLOR_10"
#define SHOW_TOOLBARS "SHOW_TOOLBARS"
#define BRIGHTNESS "BRIGHTNESS"
#define CONTRAST "CONTRAST"
@ -108,7 +108,7 @@ enum LibraryUITheme {
void addSperator(QWidget *w);
QAction *createSeparator();
QIcon noHighlightedIcon(const QString &path);
void colorize(QImage &img, QColor &col);
void colorize(QImage &img, const QColor &col);
QList<qulonglong> mimeDataToComicsIds(const QMimeData *data);
QString addExtensionToIconPath(const QString &path);
QString addExtensionToIconPathInToolbar(const QString &path);