Replace the info shadow pngs with svg versions and make them themable

This commit is contained in:
luisangelsm
2026-02-27 15:18:51 +01:00
parent 392e4a0643
commit 084146995b
16 changed files with 87 additions and 34 deletions

View File

@ -283,9 +283,6 @@ void FolderContentView::applyTheme(const Theme &theme)
// Info panel colors
ctxt->setContextProperty("infoBackgroundColor", qv.infoBackgroundColor);
ctxt->setContextProperty("topShadow", qv.topShadow.isEmpty() ? QUrl() : QUrl(qv.topShadow));
ctxt->setContextProperty("infoShadow", qv.infoShadow);
ctxt->setContextProperty("infoIndicator", qv.infoIndicator);
ctxt->setContextProperty("infoTextColor", qv.infoTextColor);
ctxt->setContextProperty("infoTitleColor", qv.infoTitleColor);

View File

@ -501,9 +501,6 @@ void GridComicsView::applyTheme(const Theme &theme)
// Info panel colors
ctxt->setContextProperty("infoBackgroundColor", qv.infoBackgroundColor);
ctxt->setContextProperty("topShadow", qv.topShadow.isEmpty() ? QUrl() : QUrl(qv.topShadow));
ctxt->setContextProperty("infoShadow", qv.infoShadow);
ctxt->setContextProperty("infoIndicator", qv.infoIndicator);
ctxt->setContextProperty("infoTextColor", qv.infoTextColor);
ctxt->setContextProperty("infoTitleColor", qv.infoTitleColor);

View File

@ -228,9 +228,9 @@ void InfoComicsView::applyTheme(const Theme &theme)
// Info panel colors
ctxt->setContextProperty("infoBackgroundColor", qv.infoBackgroundColor);
ctxt->setContextProperty("topShadow", qv.topShadow.isEmpty() ? QUrl() : QUrl(qv.topShadow));
ctxt->setContextProperty("infoShadow", qv.infoShadow);
ctxt->setContextProperty("infoIndicator", qv.infoIndicator);
ctxt->setContextProperty("topShadow", QUrl::fromLocalFile(qv.topShadow));
ctxt->setContextProperty("infoShadow", QUrl::fromLocalFile(qv.infoShadow));
ctxt->setContextProperty("infoIndicator", QUrl::fromLocalFile(qv.infoIndicator));
ctxt->setContextProperty("infoTextColor", qv.infoTextColor);
ctxt->setContextProperty("infoTitleColor", qv.infoTitleColor);

View File

@ -11,13 +11,9 @@
<file>qml/reading.svg</file>
<file>qml/star.svg</file>
<file>qml/page.svg</file>
<file>qml/info-indicator.png</file>
<file>qml/info-shadow.png</file>
<file>qml/info-indicator-light.png</file>
<file>qml/info-shadow-light.png</file>
<file>qml/info-indicator-light@2x.png</file>
<file>qml/info-shadow-light@2x.png</file>
<file>qml/info-top-shadow.png</file>
<file>qml/info-indicator.svg</file>
<file>qml/info-shadow.svg</file>
<file>qml/info-top-shadow.svg</file>
<file>qml/ComicInfoView.qml</file>
<file>qml/info-favorites.svg</file>
<file>qml/info-rating.svg</file>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 B

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 164 17">
<defs>
<style>
.cls-1 {
fill: #f0f;
}
.cls-2 {
fill: #0ff;
filter: url(#drop-shadow-1);
}
</style>
<filter id="drop-shadow-1" x="-15" y="-4" width="194" height="30" filterUnits="userSpaceOnUse">
<feOffset dx="0" dy="0"/>
<feGaussianBlur result="blur" stdDeviation="3"/>
<feFlood flood-color="#ff0" flood-opacity=".75"/>
<feComposite in2="blur" operator="in"/>
<feComposite in="SourceGraphic"/>
</filter>
</defs>
<polygon class="cls-2" points="170 17 -6 17 -6 5 81 5 89 15 97 5 170 5 170 17"/>
<polygon class="cls-1" points="170 17 -6 17 -6 6 81 6 89 16 97 6 170 6 170 17"/>
</svg>

After

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 B

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1 17">
<defs>
<style>
.cls-1 {
fill: #0ff;
filter: url(#drop-shadow-2);
}
.cls-2 {
fill: #f0f;
}
</style>
<filter id="drop-shadow-2" x="-20" y="-4" width="41" height="30" filterUnits="userSpaceOnUse">
<feOffset dx="0" dy="0"/>
<feGaussianBlur result="blur" stdDeviation="3"/>
<feFlood flood-color="#ff0" flood-opacity=".75"/>
<feComposite in2="blur" operator="in"/>
<feComposite in="SourceGraphic"/>
</filter>
</defs>
<rect class="cls-1" x="-11" y="5" width="23" height="12"/>
<rect class="cls-2" x="-11" y="6" width="23" height="11"/>
</svg>

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 B

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1 5">
<defs>
<style>
.cls-1 {
fill: #f0f;
filter: url(#drop-shadow-3);
}
</style>
<filter id="drop-shadow-3" x="-15" y="-19" width="31" height="28" filterUnits="userSpaceOnUse">
<feOffset dx="0" dy="0"/>
<feGaussianBlur result="blur" stdDeviation="3"/>
<feFlood flood-color="#ff0" flood-opacity=".75"/>
<feComposite in2="blur" operator="in"/>
<feComposite in="SourceGraphic"/>
</filter>
</defs>
<rect class="cls-1" x="-6" y="-10" width="13" height="10"/>
</svg>

After

Width:  |  Height:  |  Size: 709 B

View File

@ -226,9 +226,9 @@ struct QmlViewTheme {
// Info panel colors
QColor infoBackgroundColor;
QString topShadow; // Image filename
QString infoShadow; // Image filename
QString infoIndicator; // Image filename
QString topShadow; // Recolored SVG path
QString infoShadow; // Recolored SVG path
QString infoIndicator; // Recolored SVG path
QColor infoTextColor;
QColor infoTitleColor;

View File

@ -149,9 +149,8 @@ struct QmlViewParams {
// Info panel colors
QColor infoBackgroundColor;
QString topShadow; // Image filename
QString infoShadow; // Image filename
QString infoIndicator; // Image filename
QColor infoBorderColor;
QColor infoShadowColor;
QColor infoTextColor;
QColor infoTitleColor;
@ -494,9 +493,9 @@ Theme makeTheme(const ThemeParams &params)
theme.qmlView.textColor = qv.textColor;
theme.qmlView.showDropShadow = qv.showDropShadow;
theme.qmlView.infoBackgroundColor = qv.infoBackgroundColor;
theme.qmlView.topShadow = qv.topShadow;
theme.qmlView.infoShadow = qv.infoShadow;
theme.qmlView.infoIndicator = qv.infoIndicator;
theme.qmlView.topShadow = recoloredSvgToThemeFile(":/qml/info-top-shadow.svg", qv.infoBackgroundColor, qv.infoBorderColor, qv.infoShadowColor, params.themeName);
theme.qmlView.infoShadow = recoloredSvgToThemeFile(":/qml/info-shadow.svg", qv.infoBackgroundColor, qv.infoBorderColor, qv.infoShadowColor, params.themeName);
theme.qmlView.infoIndicator = recoloredSvgToThemeFile(":/qml/info-indicator.svg", qv.infoBackgroundColor, qv.infoBorderColor, qv.infoShadowColor, params.themeName);
theme.qmlView.infoTextColor = qv.infoTextColor;
theme.qmlView.infoTitleColor = qv.infoTitleColor;
theme.qmlView.ratingUnselectedColor = qv.ratingUnselectedColor;
@ -991,9 +990,8 @@ ThemeParams classicThemeParams()
qv.textColor = QColor(0xA8A8A8);
qv.showDropShadow = true;
qv.infoBackgroundColor = QColor(0x2E2E2E);
qv.topShadow = "info-top-shadow.png";
qv.infoShadow = "info-shadow.png";
qv.infoIndicator = "info-indicator.png";
qv.infoBorderColor = QColor(0x404040);
qv.infoShadowColor = Qt::black;
qv.infoTextColor = QColor(0xB0B0B0);
qv.infoTitleColor = QColor(0xFFFFFF);
qv.ratingUnselectedColor = QColor(0x1C1C1C);
@ -1244,9 +1242,8 @@ ThemeParams lightThemeParams()
qv.textColor = QColor(0x636363);
qv.showDropShadow = true;
qv.infoBackgroundColor = QColor(0xFFFFFF);
qv.topShadow = "";
qv.infoShadow = "info-shadow-light.png";
qv.infoIndicator = "info-indicator-light.png";
qv.infoBorderColor = QColor(0x808080);
qv.infoShadowColor = QColor(0x444444);
qv.infoTextColor = QColor(0x404040);
qv.infoTitleColor = QColor(0x2E2E2E);
qv.ratingUnselectedColor = QColor(0xDEDEDE);
@ -1497,9 +1494,8 @@ ThemeParams darkThemeParams()
qv.textColor = QColor(0xA8A8A8);
qv.showDropShadow = true;
qv.infoBackgroundColor = QColor(0x2E2E2E);
qv.topShadow = "info-top-shadow.png";
qv.infoShadow = "info-shadow.png";
qv.infoIndicator = "info-indicator.png";
qv.infoBorderColor = QColor(0x404040);
qv.infoShadowColor = Qt::black;
qv.infoTextColor = QColor(0xB0B0B0);
qv.infoTitleColor = QColor(0xFFFFFF);
qv.ratingUnselectedColor = QColor(0x1C1C1C);