Load custom icons through fallbackSearchPaths

BUG: 469567
This commit is contained in:
Bart De Vries 2023-05-10 14:30:43 +02:00
parent 47a42e7205
commit f69366f6fd
10 changed files with 11 additions and 9 deletions

View File

@ -18,7 +18,7 @@ Files: kasts.svg kasts-android-square.svg icons/kasts-tray-light.svg icons/kasts
Copyright: 2021 Mathis Brüchert <mbblp@protonmail.ch> Copyright: 2021 Mathis Brüchert <mbblp@protonmail.ch>
License: CC-BY-SA-4.0 License: CC-BY-SA-4.0
Files: icons/media-playback-start-cloud.svg Files: icons/media-playback-cloud.svg
Copyright: 2022 Bart De Vries <bart@mogwai.be> Copyright: 2022 Bart De Vries <bart@mogwai.be>
License: CC-BY-SA-4.0 License: CC-BY-SA-4.0

View File

@ -97,7 +97,7 @@ install(FILES org.kde.kasts.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES kasts.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps) install(FILES kasts.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
install(FILES icons/kasts-tray-dark.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps) install(FILES icons/kasts-tray-dark.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
install(FILES icons/kasts-tray-light.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps) install(FILES icons/kasts-tray-light.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
install(FILES icons/media-playback-start-cloud.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/actions) install(FILES icons/media-playback-cloud.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/actions)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/android/version.gradle.in ${CMAKE_BINARY_DIR}/version.gradle) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/android/version.gradle.in ${CMAKE_BINARY_DIR}/version.gradle)

View File

@ -6,5 +6,5 @@
}</style> }</style>
</defs> </defs>
<path class="ColorScheme-Text" d="m7.5 2c-2.4853 0-4.5 2.0147-4.5 4.5-0.013331 0.19965-0.013331 0.39996 0 0.59961-1.2239 0.43231-2.031 1.6027-2 2.9004 0 1.6569 1.3432 3.0142 3 3 0 0 0.191 0.01093 0.33961-0.18698 0.11373-0.20472 0.096778-0.38083-0.018045-0.59167-0.16956-0.21372-0.32156-0.22136-0.32156-0.22136-1.1045-0.00919-2-0.89543-2-2 0-1.1046 0.89543-2 2-2 0.13313-0.013393 0.26726-0.013393 0.40039 0-0.24407-0.46372-0.3809-0.97633-0.40039-1.5 0-1.933 1.567-3.5 3.5-3.5s3.5 1.567 3.5 3.5c0.01192 0.16645 0.01192 0.33355 0 0.5 0.16625-0.016709 0.33375-0.016709 0.5 0 1.3807 0 2.5 1.1193 2.5 2.5 0 1.3807-1.1195 2.4777-2.5 2.5 0 0-0.20893 0.0092-0.36684 0.20938-0.14441 0.21588-0.1159 0.50231 0.01983 0.65185 0.14494 0.13233 0.34701 0.13881 0.34701 0.13881 1.933 0.005098 3.5-1.567 3.5-3.5 0.017972-1.7535-1.2644-3.2496-3-3.5-0.25579-2.2882-2.1976-4.0143-4.5-4z" fill="currentColor"/> <path class="ColorScheme-Text" d="m7.5 2c-2.4853 0-4.5 2.0147-4.5 4.5-0.013331 0.19965-0.013331 0.39996 0 0.59961-1.2239 0.43231-2.031 1.6027-2 2.9004 0 1.6569 1.3432 3.0142 3 3 0 0 0.191 0.01093 0.33961-0.18698 0.11373-0.20472 0.096778-0.38083-0.018045-0.59167-0.16956-0.21372-0.32156-0.22136-0.32156-0.22136-1.1045-0.00919-2-0.89543-2-2 0-1.1046 0.89543-2 2-2 0.13313-0.013393 0.26726-0.013393 0.40039 0-0.24407-0.46372-0.3809-0.97633-0.40039-1.5 0-1.933 1.567-3.5 3.5-3.5s3.5 1.567 3.5 3.5c0.01192 0.16645 0.01192 0.33355 0 0.5 0.16625-0.016709 0.33375-0.016709 0.5 0 1.3807 0 2.5 1.1193 2.5 2.5 0 1.3807-1.1195 2.4777-2.5 2.5 0 0-0.20893 0.0092-0.36684 0.20938-0.14441 0.21588-0.1159 0.50231 0.01983 0.65185 0.14494 0.13233 0.34701 0.13881 0.34701 0.13881 1.933 0.005098 3.5-1.567 3.5-3.5 0.017972-1.7535-1.2644-3.2496-3-3.5-0.25579-2.2882-2.1976-4.0143-4.5-4z" fill="currentColor"/>
<path class="ColorScheme-Text" d="m5.1552 6.208v7.7927l7.7927-3.8963z" color="#232629" fill="currentColor" stroke-width="1.2191"/> <path class="ColorScheme-Text" d="m5.1552 6.208v7.7927l7.7927-3.8963z" fill="currentColor"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -241,6 +241,7 @@ if(ANDROID)
application-exit application-exit
starred-symbolic starred-symbolic
non-starred-symbolic non-starred-symbolic
media-playback-cloud
) )
else() else()
target_link_libraries(kasts PRIVATE Qt::Widgets) target_link_libraries(kasts PRIVATE Qt::Widgets)

View File

@ -98,6 +98,8 @@ int main(int argc, char *argv[])
app.setFont(font); app.setFont(font);
#endif #endif
QIcon::setFallbackSearchPaths(QIcon::fallbackSearchPaths() << QStringLiteral(":custom-icons"));
QCoreApplication::setOrganizationName(QStringLiteral("KDE")); QCoreApplication::setOrganizationName(QStringLiteral("KDE"));
QCoreApplication::setOrganizationDomain(QStringLiteral("kde.org")); QCoreApplication::setOrganizationDomain(QStringLiteral("kde.org"));
QCoreApplication::setApplicationName(QStringLiteral("Kasts")); QCoreApplication::setApplicationName(QStringLiteral("Kasts"));

View File

@ -36,8 +36,7 @@ Kirigami.BasicListItem {
} }
trailing: Controls.ToolButton { trailing: Controls.ToolButton {
icon.name: streamingButtonVisible ? "" : "media-playback-start" icon.name: streamingButtonVisible ? "media-playback-cloud" : "media-playback-start"
icon.source: streamingButtonVisible ? "qrc:/media-playback-start-cloud" : ""
text: i18n("Play") text: i18n("Play")
enabled: entry != undefined && entry.enclosure && (entry.enclosure.status === Enclosure.Downloaded || streamingButtonVisible) enabled: entry != undefined && entry.enclosure && (entry.enclosure.status === Enclosure.Downloaded || streamingButtonVisible)
display: Controls.Button.IconOnly display: Controls.Button.IconOnly

View File

@ -153,7 +153,7 @@ Kirigami.ScrollablePage {
Kirigami.Action { Kirigami.Action {
text: i18nc("@action:intoolbar Action to start playback by streaming the episode rather than downloading it first", "Stream") text: i18nc("@action:intoolbar Action to start playback by streaming the episode rather than downloading it first", "Stream")
visible: entry.enclosure && entry.enclosure.status !== Enclosure.Downloaded && (AudioManager.entry !== entry || AudioManager.playbackState !== KMediaSession.PlayingState) visible: entry.enclosure && entry.enclosure.status !== Enclosure.Downloaded && (AudioManager.entry !== entry || AudioManager.playbackState !== KMediaSession.PlayingState)
icon.source: "qrc:/media-playback-start-cloud" icon.name: "media-playback-cloud"
onTriggered: { onTriggered: {
if (!entry.queueStatus) { if (!entry.queueStatus) {
entry.queueStatus = true; entry.queueStatus = true;

View File

@ -339,7 +339,7 @@ Kirigami.SwipeListItem {
}, },
Kirigami.Action { Kirigami.Action {
text: i18nc("@action:inmenu Action to start playback by streaming the episode rather than downloading it first", "Stream") text: i18nc("@action:inmenu Action to start playback by streaming the episode rather than downloading it first", "Stream")
icon.source: "qrc:/media-playback-start-cloud" icon.name: "media-playback-cloud"
visible: showStreamingPlayButton visible: showStreamingPlayButton
onTriggered: { onTriggered: {
if (!entry.queueStatus) { if (!entry.queueStatus) {

View File

@ -232,7 +232,7 @@ ListView {
readonly property var streamAction: Kirigami.Action { readonly property var streamAction: Kirigami.Action {
text: i18nc("@action:inmenu Action to start playback by streaming the episode rather than downloading it first", "Stream") text: i18nc("@action:inmenu Action to start playback by streaming the episode rather than downloading it first", "Stream")
icon.source: "qrc:/media-playback-start-cloud" icon.name: "media-playback-cloud"
visible: listView.selectionModel.hasSelection && (singleSelectedEntry ? (singleSelectedEntry.hasEnclosure ? singleSelectedEntry.enclosure.status !== Enclosure.Downloaded : false) : false) visible: listView.selectionModel.hasSelection && (singleSelectedEntry ? (singleSelectedEntry.hasEnclosure ? singleSelectedEntry.enclosure.status !== Enclosure.Downloaded : false) : false)
onTriggered: { onTriggered: {
if (!singleSelectedEntry.queueStatus) { if (!singleSelectedEntry.queueStatus) {

View File

@ -47,6 +47,6 @@
<file alias="logo.svg">../kasts.svg</file> <file alias="logo.svg">../kasts.svg</file>
<file alias="kasts-tray-light.svg">../icons/kasts-tray-light.svg</file> <file alias="kasts-tray-light.svg">../icons/kasts-tray-light.svg</file>
<file alias="kasts-tray-dark.svg">../icons/kasts-tray-dark.svg</file> <file alias="kasts-tray-dark.svg">../icons/kasts-tray-dark.svg</file>
<file alias="media-playback-start-cloud">../icons/media-playback-start-cloud.svg</file> <file alias="custom-icons/media-playback-cloud.svg">../icons/media-playback-cloud.svg</file>
</qresource> </qresource>
</RCC> </RCC>