From 94a5f981a761efdcecd7d93a0162b9b975cc94c4 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Fri, 23 Oct 2020 01:53:04 +0300 Subject: [PATCH] [app] Dropped HarbourImageProvider HarbourHighlightIcon works better --- app/app.pro | 2 -- app/qml/BooksStorageHeader.qml | 28 ++++++++++++---------- app/qml/images/sdcard.svg | 44 +++++++++++++--------------------- app/src/ZLibrary.cpp | 2 -- 4 files changed, 32 insertions(+), 44 deletions(-) diff --git a/app/app.pro b/app/app.pro index 47181ed..aeb0e46 100644 --- a/app/app.pro +++ b/app/app.pro @@ -178,7 +178,6 @@ HEADERS += \ HEADERS += \ $$HARBOUR_INCLUDE_DIR/HarbourDisplayBlanking.h \ - $$HARBOUR_INCLUDE_DIR/HarbourImageProvider.h \ $$HARBOUR_INCLUDE_DIR/HarbourJson.h \ $$HARBOUR_INCLUDE_DIR/HarbourMediaPlugin.h \ $$HARBOUR_INCLUDE_DIR/HarbourPluginLoader.h \ @@ -192,7 +191,6 @@ HEADERS += \ SOURCES += \ $$HARBOUR_SRC_DIR/HarbourDisplayBlanking.cpp \ - $$HARBOUR_SRC_DIR/HarbourImageProvider.cpp \ $$HARBOUR_SRC_DIR/HarbourJson.cpp \ $$HARBOUR_SRC_DIR/HarbourMce.cpp \ $$HARBOUR_SRC_DIR/HarbourMediaPlugin.cpp \ diff --git a/app/qml/BooksStorageHeader.qml b/app/qml/BooksStorageHeader.qml index 2a49a8d..64d38ea 100644 --- a/app/qml/BooksStorageHeader.qml +++ b/app/qml/BooksStorageHeader.qml @@ -1,6 +1,6 @@ /* - Copyright (C) 2015-2018 Jolla Ltd. - Copyright (C) 2015-2018 Slava Monich + Copyright (C) 2015-2020 Jolla Ltd. + Copyright (C) 2015-2020 Slava Monich You may use this file under the terms of BSD license as follows: @@ -8,14 +8,15 @@ modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Jolla Ltd nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + 3. Neither the names of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -33,6 +34,8 @@ import QtQuick 2.0 import Sailfish.Silica 1.0 +import "harbour" + Column { id: root anchors { @@ -73,7 +76,7 @@ Column { width: parent.width height: Math.max(storageLabel.height, bookCount.height) - Image { + HarbourHighlightIcon { id: icon anchors { left: parent.left @@ -84,7 +87,8 @@ Column { height: storageLabel.height*3/4 sourceSize.height: height fillMode: Image.PreserveAspectFit - source: "image://harbour/" + Qt.resolvedUrl("images/sdcard.svg") + "?" + storageLabel.color + source: "images/sdcard.svg" + highlightColor: storageLabel.color } Label { diff --git a/app/qml/images/sdcard.svg b/app/qml/images/sdcard.svg index f61f900..6e1eb93 100644 --- a/app/qml/images/sdcard.svg +++ b/app/qml/images/sdcard.svg @@ -1,35 +1,23 @@ - - - - - - image/svg+xml - - - - - + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="80" + height="60" + version="1.1" + inkscape:version="0.92.4 (unknown)" + sodipodi:docname="sdcard.svg"> + inkscape:groupmode="layer" + transform="translate(-654.28125,-625.21875)"> diff --git a/app/src/ZLibrary.cpp b/app/src/ZLibrary.cpp index 5c1c637..abe0b15 100644 --- a/app/src/ZLibrary.cpp +++ b/app/src/ZLibrary.cpp @@ -39,7 +39,6 @@ #include "BooksSettings.h" #include "HarbourDebug.h" -#include "HarbourImageProvider.h" #include "HarbourMediaPlugin.h" #include "HarbourPolicyPlugin.h" @@ -248,7 +247,6 @@ void ZLibrary::run(ZLApplication* aApp) BOOKS_QML_PLUGIN_V1, BOOKS_QML_PLUGIN_V2); HarbourMediaPlugin::registerTypes(engine, BOOKS_QML_PLUGIN, BOOKS_QML_PLUGIN_V1, BOOKS_QML_PLUGIN_V2); - engine->addImageProvider("harbour", new HarbourImageProvider); engine->addImageProvider(BooksImageProvider::PROVIDER_ID, new BooksImageProvider(root));