mirror of
https://github.com/YACReader/yacreader
synced 2026-03-01 10:22:58 -05:00
Add toolbar and background theming to YACReader
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user