diff --git a/YACReaderLibrary/images.qrc b/YACReaderLibrary/images.qrc
index b221181e..86783e83 100644
--- a/YACReaderLibrary/images.qrc
+++ b/YACReaderLibrary/images.qrc
@@ -42,7 +42,7 @@
../images/flow3.png
../images/flow4.png
../images/flow5.png
- ../images/glowLine.png
+ ../images/glowLine.svg
../images/metadata_dialog/loadCustomCover.svg
../images/import/coversToggle.svg
../images/icon-new.svg
@@ -74,7 +74,7 @@
../images/library_dialogs/new.svg
../images/metadata_dialog/nextCoverPage.svg
../images/noLibrariesIcon.svg
- ../images/noLibrariesLine.png
+ ../images/noLibrariesLine.svg
../images/notCover.png
../images/library_dialogs/openLibrary.svg
../images/metadata_dialog/previousCoverPage.svg
@@ -111,13 +111,11 @@
../images/import/updatingIcon.svg
../images/custom_dialog/custom_close_button.svg
../images/whats_new/whatsnew_header.svg
-
../images/lists/default_0.svg
../images/lists/default_1.svg
../images/lists/default_2.svg
../images/lists/label_template.svg
../images/lists/list.svg
-
../images/clearSearchNew.svg
../images/iconSearchNew.svg
diff --git a/YACReaderLibrary/import_widget.cpp b/YACReaderLibrary/import_widget.cpp
index 9c393581..9dafa395 100644
--- a/YACReaderLibrary/import_widget.cpp
+++ b/YACReaderLibrary/import_widget.cpp
@@ -23,6 +23,8 @@ class YACReaderActivityIndicatorWidget : public QWidget
{
public:
YACReaderActivityIndicatorWidget(QWidget *parent = 0);
+ void setPixmaps(const QPixmap &normalLine, const QPixmap &glowLine);
+
public slots:
private:
@@ -31,16 +33,11 @@ private:
};
YACReaderActivityIndicatorWidget::YACReaderActivityIndicatorWidget(QWidget *parent)
- : QWidget(parent)
+ : QWidget(parent), normal(nullptr), glow(nullptr)
{
- QPixmap line(":/images/noLibrariesLine.png");
- QPixmap glowLine(":/images/glowLine.png");
normal = new QLabel(this);
glow = new QLabel(this);
- normal->setPixmap(line);
- glow->setPixmap(glowLine);
-
auto layout = new QHBoxLayout();
layout->addWidget(normal, 0, Qt::AlignVCenter);
@@ -50,11 +47,6 @@ YACReaderActivityIndicatorWidget::YACReaderActivityIndicatorWidget(QWidget *pare
layout->setContentsMargins(4, 4, 4, 4);
layout->setSpacing(0);
- // setFixedHeight(3);
- // resize(579,3);
- glow->setGeometry(4, 4, glowLine.width(), glowLine.height());
- // normal->setGeometry(0,1,579,1);
-
auto effect = new QGraphicsOpacityEffect();
// effect->setOpacity(1.0);
@@ -80,6 +72,13 @@ YACReaderActivityIndicatorWidget::YACReaderActivityIndicatorWidget(QWidget *pare
animation->start();
}
+void YACReaderActivityIndicatorWidget::setPixmaps(const QPixmap &normalLine, const QPixmap &glowLine)
+{
+ normal->setPixmap(normalLine);
+ glow->setPixmap(glowLine);
+ glow->setGeometry(4, 4, glowLine.width(), glowLine.height());
+}
+
ImportWidget::ImportWidget(QWidget *parent)
: QWidget(parent)
{
@@ -88,7 +87,7 @@ ImportWidget::ImportWidget(QWidget *parent)
iconLabel = new QLabel();
- auto activityIndicator = new YACReaderActivityIndicatorWidget();
+ activityIndicator = new YACReaderActivityIndicatorWidget();
text = new QLabel();
textDescription = new QLabel();
@@ -399,6 +398,9 @@ void ImportWidget::applyTheme(const Theme &theme)
bottomDecorator->setPixmap(importTheme.bottomCoversDecoration);
bottomDecorator->setFixedHeight(importTheme.bottomCoversDecoration.height());
+ const auto &noLibrariesWidget = theme.noLibrariesWidget;
+ activityIndicator->setPixmaps(noLibrariesWidget.noLibrariesLinePixmap, importTheme.glowLinePixmap);
+
// Apply text colors
updateTextColors();
}
diff --git a/YACReaderLibrary/import_widget.h b/YACReaderLibrary/import_widget.h
index 945b38aa..9da45b84 100644
--- a/YACReaderLibrary/import_widget.h
+++ b/YACReaderLibrary/import_widget.h
@@ -14,6 +14,8 @@
#include
#include
+class YACReaderActivityIndicatorWidget;
+
class ImportWidget : public QWidget, protected Themable
{
Q_OBJECT
@@ -57,6 +59,7 @@ private:
QToolButton *hideButton;
QLabel *topDecorator;
QLabel *bottomDecorator;
+ YACReaderActivityIndicatorWidget *activityIndicator;
void resizeEvent(QResizeEvent *event) override;
void updateTextColors();
diff --git a/YACReaderLibrary/no_libraries_widget.cpp b/YACReaderLibrary/no_libraries_widget.cpp
index ec5865a0..8a539601 100644
--- a/YACReaderLibrary/no_libraries_widget.cpp
+++ b/YACReaderLibrary/no_libraries_widget.cpp
@@ -13,9 +13,7 @@ NoLibrariesWidget::NoLibrariesWidget(QWidget *parent)
iconLabel = new QLabel();
- QPixmap line(":/images/noLibrariesLine.png");
- QLabel *lineLabel = new QLabel();
- lineLabel->setPixmap(line);
+ lineLabel = new QLabel();
text = new QLabel(tr("You don't have any libraries yet"));
text->setStyleSheet("QLabel {font-size:25px;font-weight:bold;}");
@@ -75,19 +73,20 @@ NoLibrariesWidget::NoLibrariesWidget(QWidget *parent)
void NoLibrariesWidget::applyTheme(const Theme &theme)
{
- auto emptyTheme = theme.emptyContainer;
+ auto nlwTheme = theme.noLibrariesWidget;
QPalette p(palette());
- p.setColor(QPalette::Window, emptyTheme.backgroundColor);
+ p.setColor(QPalette::Window, nlwTheme.backgroundColor);
setPalette(p);
QPalette textPalette = text->palette();
- textPalette.setColor(QPalette::WindowText, emptyTheme.textColor);
+ textPalette.setColor(QPalette::WindowText, nlwTheme.textColor);
text->setPalette(textPalette);
QPalette descPalette = textDescription->palette();
- descPalette.setColor(QPalette::WindowText, emptyTheme.descriptionTextColor);
+ descPalette.setColor(QPalette::WindowText, nlwTheme.descriptionTextColor);
textDescription->setPalette(descPalette);
- iconLabel->setPixmap(emptyTheme.noLibrariesIcon);
+ iconLabel->setPixmap(nlwTheme.noLibrariesIcon);
+ lineLabel->setPixmap(nlwTheme.noLibrariesLinePixmap);
}
diff --git a/YACReaderLibrary/no_libraries_widget.h b/YACReaderLibrary/no_libraries_widget.h
index 4e0ea74f..19967071 100644
--- a/YACReaderLibrary/no_libraries_widget.h
+++ b/YACReaderLibrary/no_libraries_widget.h
@@ -25,6 +25,7 @@ private:
QLabel *iconLabel;
QLabel *text;
QLabel *textDescription;
+ QLabel *lineLabel;
};
#endif // NO_LIBRARIES_WIDGET_H
diff --git a/YACReaderLibrary/themes/builtin_classic.json b/YACReaderLibrary/themes/builtin_classic.json
index 10c301cd..9afcec68 100644
--- a/YACReaderLibrary/themes/builtin_classic.json
+++ b/YACReaderLibrary/themes/builtin_classic.json
@@ -39,9 +39,7 @@
},
"emptyContainer": {
"backgroundColor": "#2a2a2a",
- "descriptionTextColor": "#aaaaaa",
- "searchIconColor": "#4c4c4c",
- "textColor": "#cccccc",
+ "iconColor": "#4c4c4c",
"titleTextColor": "#cccccc"
},
"gridAndInfoView": {
@@ -97,6 +95,7 @@
"coversViewBackgroundColor": "#3a3a3a",
"currentComicTextColor": "#aaaaaa",
"descriptionTextColor": "#aaaaaa",
+ "glowLineColor": "#ffe100",
"iconCheckedColor": "#aaaaaa",
"iconColor": "#cccccc",
"modeIconColor": "#4a4a4a",
@@ -179,6 +178,13 @@
"selectionBackgroundColor": "#2e2e2e",
"textColor": "#dddfdf"
},
+ "noLibrariesWidget": {
+ "backgroundColor": "#2a2a2a",
+ "descriptionTextColor": "#aaaaaa",
+ "iconColor": "#4c4c4c",
+ "noLibrariesLineColor": "#a8a8a8",
+ "textColor": "#cccccc"
+ },
"readingListIcons": {
"currentlyReadingMainColor": "#ffcc00",
"currentlyReadingMainSelectedColor": "#ffcc00",
diff --git a/YACReaderLibrary/themes/builtin_dark.json b/YACReaderLibrary/themes/builtin_dark.json
index 2f5a4f41..7a26d484 100644
--- a/YACReaderLibrary/themes/builtin_dark.json
+++ b/YACReaderLibrary/themes/builtin_dark.json
@@ -39,9 +39,7 @@
},
"emptyContainer": {
"backgroundColor": "#2a2a2a",
- "descriptionTextColor": "#aaaaaa",
- "searchIconColor": "#4c4c4c",
- "textColor": "#cccccc",
+ "iconColor": "#4c4c4c",
"titleTextColor": "#cccccc"
},
"gridAndInfoView": {
@@ -97,6 +95,7 @@
"coversViewBackgroundColor": "#3a3a3a",
"currentComicTextColor": "#aaaaaa",
"descriptionTextColor": "#aaaaaa",
+ "glowLineColor": "#ffe100",
"iconCheckedColor": "#aaaaaa",
"iconColor": "#cccccc",
"modeIconColor": "#4a4a4a",
@@ -179,6 +178,13 @@
"selectionBackgroundColor": "#2e2e2e",
"textColor": "#dddfdf"
},
+ "noLibrariesWidget": {
+ "backgroundColor": "#2a2a2a",
+ "descriptionTextColor": "#aaaaaa",
+ "iconColor": "#4c4c4c",
+ "noLibrariesLineColor": "#a8a8a8",
+ "textColor": "#cccccc"
+ },
"readingListIcons": {
"currentlyReadingMainColor": "#ffcc00",
"currentlyReadingMainSelectedColor": "#ffcc00",
diff --git a/YACReaderLibrary/themes/builtin_light.json b/YACReaderLibrary/themes/builtin_light.json
index 25d88e86..9742b606 100644
--- a/YACReaderLibrary/themes/builtin_light.json
+++ b/YACReaderLibrary/themes/builtin_light.json
@@ -39,9 +39,7 @@
},
"emptyContainer": {
"backgroundColor": "#ffffff",
- "descriptionTextColor": "#565959",
- "searchIconColor": "#cccccc",
- "textColor": "#495252",
+ "iconColor": "#cccccc",
"titleTextColor": "#888888"
},
"gridAndInfoView": {
@@ -97,6 +95,7 @@
"coversViewBackgroundColor": "#e6e6e6",
"currentComicTextColor": "#565959",
"descriptionTextColor": "#565959",
+ "glowLineColor": "#ffe100",
"iconCheckedColor": "#565959",
"iconColor": "#495252",
"modeIconColor": "#e6e6e6",
@@ -179,6 +178,13 @@
"selectionBackgroundColor": "#333133",
"textColor": "#000000"
},
+ "noLibrariesWidget": {
+ "backgroundColor": "#ffffff",
+ "descriptionTextColor": "#565959",
+ "iconColor": "#cccccc",
+ "noLibrariesLineColor": "#a8a8a8",
+ "textColor": "#495252"
+ },
"readingListIcons": {
"currentlyReadingMainColor": "#ffcc00",
"currentlyReadingMainSelectedColor": "#ffcc00",
diff --git a/YACReaderLibrary/themes/theme.h b/YACReaderLibrary/themes/theme.h
index 54ba16ad..6117dd4f 100644
--- a/YACReaderLibrary/themes/theme.h
+++ b/YACReaderLibrary/themes/theme.h
@@ -122,11 +122,6 @@ struct EmptyContainerTheme {
QColor backgroundColor;
QString titleLabelQSS;
- // For NoLibrariesWidget
- QColor textColor;
- QColor descriptionTextColor;
- QPixmap noLibrariesIcon;
-
// Search-related icons (themed from search_result.svg)
QPixmap searchingIcon; // For ClassicComicsView searching state
QPixmap noSearchResultsIcon; // For NoSearchResultsWidget empty state
@@ -139,6 +134,14 @@ struct EmptyContainerTheme {
QMap emptyLabelIcons; // Keyed by YACReader::LabelColors enum value
};
+struct NoLibrariesWidgetTheme {
+ QColor backgroundColor; // Background of the widget
+ QColor textColor; // Main title text color
+ QColor descriptionTextColor; // Description text color
+ QPixmap noLibrariesIcon; // Icon displayed in the widget
+ QPixmap noLibrariesLinePixmap; // Themed horizontal line separator
+};
+
struct SidebarTheme {
QColor backgroundColor;
QColor separatorColor;
@@ -172,6 +175,7 @@ struct ImportWidgetTheme {
QPixmap importingIcon;
QPixmap updatingIcon;
QIcon coversToggleIcon;
+ QPixmap glowLinePixmap; // Themed glow line animation
};
struct NavigationTreeThemeTemplates {
@@ -491,6 +495,7 @@ struct Theme {
HelpAboutDialogTheme helpAboutDialog;
WhatsNewDialogTheme whatsNewDialog;
EmptyContainerTheme emptyContainer;
+ NoLibrariesWidgetTheme noLibrariesWidget;
SidebarTheme sidebar;
SidebarIconsTheme sidebarIcons;
LibraryItemTheme libraryItem;
diff --git a/YACReaderLibrary/themes/theme_factory.cpp b/YACReaderLibrary/themes/theme_factory.cpp
index 22f21611..9ecf3e6d 100644
--- a/YACReaderLibrary/themes/theme_factory.cpp
+++ b/YACReaderLibrary/themes/theme_factory.cpp
@@ -60,11 +60,15 @@ struct EmptyContainerParams {
QColor backgroundColor;
QColor titleTextColor;
- // For NoLibrariesWidget
+ QColor iconColor;
+};
+
+struct NoLibrariesWidgetParams {
+ QColor backgroundColor;
QColor textColor;
QColor descriptionTextColor;
-
- QColor searchIconColor; // Color for search-related icons (replaces #f0f in search_result.svg)
+ QColor iconColor;
+ QColor noLibrariesLineColor;
};
struct SidebarParams {
@@ -94,6 +98,7 @@ struct ImportWidgetParams {
QColor modeIconColor;
QColor iconColor;
QColor iconCheckedColor;
+ QColor glowLineColor;
};
struct NavigationTreeParams {
@@ -345,6 +350,7 @@ struct ThemeParams {
MetadataScraperDialogParams metadataScraperDialogParams;
HelpAboutDialogTheme helpAboutDialogParams;
EmptyContainerParams emptyContainerParams;
+ NoLibrariesWidgetParams noLibrariesWidgetParams;
SidebarParams sidebarParams;
SidebarIconsParams sidebarIconsParams;
LibraryItemParams libraryItemParams;
@@ -457,21 +463,19 @@ Theme makeTheme(const ThemeParams ¶ms)
theme.emptyContainer.backgroundColor = ec.backgroundColor;
theme.emptyContainer.titleLabelQSS = ect.titleLabelQSS.arg(ec.titleTextColor.name());
- theme.emptyContainer.textColor = ec.textColor;
- theme.emptyContainer.descriptionTextColor = ec.descriptionTextColor;
- theme.emptyContainer.noLibrariesIcon = renderSvgToPixmap(recoloredSvgToThemeFile(":/images/noLibrariesIcon.svg", ec.searchIconColor, params.meta.id), 165, 160, qApp->devicePixelRatio());
{
const qreal dpr = qApp->devicePixelRatio();
- theme.emptyContainer.searchingIcon = renderSvgToPixmap(recoloredSvgToThemeFile(":/images/search_result.svg", ec.searchIconColor, params.meta.id, { .suffix = "_searching" }), 97, dpr);
- theme.emptyContainer.noSearchResultsIcon = renderSvgToPixmap(recoloredSvgToThemeFile(":/images/search_result.svg", ec.searchIconColor, params.meta.id, { .suffix = "_no_results" }), 239, dpr);
+ const auto &rli = params.readingListIconsParams;
- theme.emptyContainer.emptyFolderIcon = renderSvgToPixmap(recoloredSvgToThemeFile(":/images/empty_container/empty_folder.svg", ec.searchIconColor, params.meta.id), 319, 243, dpr);
- theme.emptyContainer.emptyFavoritesIcon = renderSvgToPixmap(recoloredSvgToThemeFile(":/images/empty_container/empty_favorites.svg", QColor(0xe84853), params.meta.id), 238, 223, dpr);
- theme.emptyContainer.emptyCurrentReadingsIcon = renderSvgToPixmap(recoloredSvgToThemeFile(":/images/empty_container/empty_current_readings.svg", ec.searchIconColor, params.meta.id), 167, 214, dpr);
- theme.emptyContainer.emptyReadingListIcon = renderSvgToPixmap(recoloredSvgToThemeFile(":/images/empty_container/empty_reading_list.svg", ec.searchIconColor, params.meta.id), 248, 187, dpr);
+ theme.emptyContainer.searchingIcon = renderSvgToPixmap(recoloredSvgToThemeFile(":/images/search_result.svg", ec.iconColor, params.meta.id, { .suffix = "_searching" }), 97, dpr);
+ theme.emptyContainer.noSearchResultsIcon = renderSvgToPixmap(recoloredSvgToThemeFile(":/images/search_result.svg", ec.iconColor, params.meta.id, { .suffix = "_no_results" }), 239, dpr);
+
+ theme.emptyContainer.emptyFolderIcon = renderSvgToPixmap(recoloredSvgToThemeFile(":/images/empty_container/empty_folder.svg", ec.iconColor, params.meta.id), 319, 243, dpr);
+ theme.emptyContainer.emptyFavoritesIcon = renderSvgToPixmap(recoloredSvgToThemeFile(":/images/empty_container/empty_favorites.svg", rli.favoritesMainColor, params.meta.id), 238, 223, dpr);
+ theme.emptyContainer.emptyCurrentReadingsIcon = renderSvgToPixmap(recoloredSvgToThemeFile(":/images/empty_container/empty_current_readings.svg", ec.iconColor, params.meta.id), 167, 214, dpr);
+ theme.emptyContainer.emptyReadingListIcon = renderSvgToPixmap(recoloredSvgToThemeFile(":/images/empty_container/empty_reading_list.svg", ec.iconColor, params.meta.id), 248, 187, dpr);
// Generate empty label icons for each label color
- const auto &rli = params.readingListIconsParams;
for (int c = YACReader::YRed; c <= YACReader::YDark; ++c) {
auto labelColor = static_cast(c);
auto colorName = YACReader::colorToName(labelColor);
@@ -484,6 +488,21 @@ Theme makeTheme(const ThemeParams ¶ms)
}
// end EmptyContainer
+ // NoLibrariesWidget
+ const auto &nlw = params.noLibrariesWidgetParams;
+ const qreal dprNLW = qApp->devicePixelRatio();
+
+ theme.noLibrariesWidget.backgroundColor = nlw.backgroundColor;
+ theme.noLibrariesWidget.textColor = nlw.textColor;
+ theme.noLibrariesWidget.descriptionTextColor = nlw.descriptionTextColor;
+ theme.noLibrariesWidget.noLibrariesIcon = renderSvgToPixmap(
+ recoloredSvgToThemeFile(":/images/noLibrariesIcon.svg", nlw.iconColor, params.meta.id),
+ 165, 160, dprNLW);
+ theme.noLibrariesWidget.noLibrariesLinePixmap = renderSvgToPixmap(
+ recoloredSvgToThemeFile(":/images/noLibrariesLine.svg", nlw.noLibrariesLineColor, params.meta.id),
+ 579, 1, dprNLW);
+ // end NoLibrariesWidget
+
// Sidebar
const auto &sb = params.sidebarParams;
theme.sidebar.backgroundColor = sb.backgroundColor;
@@ -508,6 +527,8 @@ Theme makeTheme(const ThemeParams ¶ms)
theme.importWidget.bottomCoversDecoration = QPixmap(recoloredSvgToThemeFile(":/images/import/importBottomCoversDecoration.svg", iw.coversDecorationBgColor, iw.coversDecorationShadowColor, params.meta.id));
theme.importWidget.importingIcon = QPixmap(recoloredSvgToThemeFile(":/images/import/importingIcon.svg", iw.modeIconColor, params.meta.id));
theme.importWidget.updatingIcon = QPixmap(recoloredSvgToThemeFile(":/images/import/updatingIcon.svg", iw.modeIconColor, params.meta.id));
+ // glowLine: 579x5 glow line animation
+ theme.importWidget.glowLinePixmap = renderSvgToPixmap(recoloredSvgToThemeFile(":/images/glowLine.svg", iw.glowLineColor, params.meta.id), 579, 5, qApp->devicePixelRatio());
{
QIcon coversToggle;
const QString normalPath = recoloredSvgToThemeFile(":/images/import/coversToggle.svg", iw.iconColor, params.meta.id);
@@ -1005,9 +1026,17 @@ Theme makeTheme(const QJsonObject &json)
auto &ec = p.emptyContainerParams;
ec.backgroundColor = colorFromJson(o, "backgroundColor", ec.backgroundColor);
ec.titleTextColor = colorFromJson(o, "titleTextColor", ec.titleTextColor);
- ec.textColor = colorFromJson(o, "textColor", ec.textColor);
- ec.descriptionTextColor = colorFromJson(o, "descriptionTextColor", ec.descriptionTextColor);
- ec.searchIconColor = colorFromJson(o, "searchIconColor", ec.searchIconColor);
+ ec.iconColor = colorFromJson(o, "iconColor", ec.iconColor);
+ }
+
+ if (json.contains("noLibrariesWidget")) {
+ const auto o = json["noLibrariesWidget"].toObject();
+ auto &nlw = p.noLibrariesWidgetParams;
+ nlw.backgroundColor = colorFromJson(o, "backgroundColor", nlw.backgroundColor);
+ nlw.textColor = colorFromJson(o, "textColor", nlw.textColor);
+ nlw.descriptionTextColor = colorFromJson(o, "descriptionTextColor", nlw.descriptionTextColor);
+ nlw.iconColor = colorFromJson(o, "iconColor", nlw.iconColor);
+ nlw.noLibrariesLineColor = colorFromJson(o, "noLibrariesLineColor", nlw.noLibrariesLineColor);
}
if (json.contains("sidebar")) {
@@ -1058,6 +1087,7 @@ Theme makeTheme(const QJsonObject &json)
iw.modeIconColor = colorFromJson(o, "modeIconColor", iw.modeIconColor);
iw.iconColor = colorFromJson(o, "iconColor", iw.iconColor);
iw.iconCheckedColor = colorFromJson(o, "iconCheckedColor", iw.iconCheckedColor);
+ iw.glowLineColor = colorFromJson(o, "glowLineColor", iw.glowLineColor);
}
if (json.contains("serverConfigDialog")) {
diff --git a/images/glowLine.png b/images/glowLine.png
deleted file mode 100644
index 13ee7b3b..00000000
Binary files a/images/glowLine.png and /dev/null differ
diff --git a/images/glowLine.svg b/images/glowLine.svg
new file mode 100644
index 00000000..f32a3ade
--- /dev/null
+++ b/images/glowLine.svg
@@ -0,0 +1,75 @@
+
+
\ No newline at end of file
diff --git a/images/noLibrariesLine.png b/images/noLibrariesLine.png
deleted file mode 100644
index 18599349..00000000
Binary files a/images/noLibrariesLine.png and /dev/null differ
diff --git a/images/noLibrariesLine.svg b/images/noLibrariesLine.svg
new file mode 100644
index 00000000..316f51f7
--- /dev/null
+++ b/images/noLibrariesLine.svg
@@ -0,0 +1,43 @@
+
+
\ No newline at end of file