Skip to content

Commit

Permalink
fix(qml): properly show source icon on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Apr 25, 2024
1 parent 042d48f commit 6841d38
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gui-qml/src/components/SearchScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 202,7 @@ Page {
id: sourcesButton
background.anchors.fill: sourcesButton
implicitWidth: 50
icon.source: "file:///" searchTab.site.icon
icon.source: searchTab.site.icon
icon.color: "transparent"
leftPadding: 0
rightPadding: 0
Expand Down
12 changes: 12 additions & 0 deletions src/gui-qml/src/models/qml-site.cpp
Original file line number Diff line number Diff line change
@@ -0,0 1,12 @@
#include "models/qml-site.h"


QString QmlSite::icon() const
{
const QString &icon = m_source->getPath().readPath("icon.png");
#if not defined(Q_OS_ANDROID)
return "file:///" icon;
#else
return icon;
#endif
}
2 changes: 1 addition & 1 deletion src/gui-qml/src/models/qml-site.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 31,7 @@ class QmlSite : public QObject

QString url() const { return m_site->url(); }
QString name() const { return m_site->name(); }
QString icon() const { return m_source->getPath().readPath("icon.png"); }
QString icon() const;
Settings *settings() const { return m_settings; }
QList<QmlAuth*> authFields() const { return m_fields; }

Expand Down

0 comments on commit 6841d38

Please sign in to comment.