qrc:/// => image://
authorCamila Ayres <hello@camilasan.com>
Thu, 5 Sep 2024 17:31:38 +0000 (19:31 +0200)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 6 Sep 2024 08:55:45 +0000 (10:55 +0200)
Signed-off-by: Camila Ayres <hello@camilasan.com>
src/gui/ErrorBox.qml
src/gui/tray/UnifiedSearchResultNothingFound.qml
src/gui/tray/Window.qml
src/gui/tray/activitydata.cpp
src/gui/tray/activitylistmodel.cpp

index f51fd417dce5bb2202302eacce4529c908ce87b6..10699b90b665b8bdc745454aadd945a426ffb584 100644 (file)
@@ -70,7 +70,7 @@ Item {
 
             background: null
             icon.color: palette.buttonText
-            icon.source: "qrc:///client/theme/close.svg"
+            icon.source: "image://svgimage-custom-color/close.svg"
 
             visible: errorBox.showCloseButton
             enabled: visible
index 281d20e12b137433f4c61ec556f16479ca6448ef..175874e57aa3914e6614144a5910162601399696 100644 (file)
@@ -29,7 +29,7 @@ ColumnLayout {
 
     Image {
         id: unifiedSearchResultsNoResultsLabelIcon
-        source: "qrc:///client/theme/magnifying-glass.svg"
+        source: "image://svgimage-custom-color/magnifying-glass.svg"
         sourceSize.width: Style.trayWindowHeaderHeight / 2
         sourceSize.height: Style.trayWindowHeaderHeight / 2
         Layout.alignment: Qt.AlignHCenter
index c501091205d3a68270831ce9b3843966e8b23dbd..ccb192781597a18026628e14b10645b3c0006958 100644 (file)
@@ -326,7 +326,7 @@ ApplicationWindow {
                                 Image {\r
                                     Layout.leftMargin: 12\r
                                     verticalAlignment: Qt.AlignCenter\r
-                                    source: Theme.darkMode ? "qrc:///client/theme/white/add.svg" : "qrc:///client/theme/black/add.svg"\r
+                                    source: "image://svgimage-custom-color/add.svg"\r
                                     sourceSize.width: Style.headerButtonIconSize\r
                                     sourceSize.height: Style.headerButtonIconSize\r
                                 }\r
@@ -513,7 +513,7 @@ ApplicationWindow {
                                 Layout.alignment: Qt.AlignRight\r
                                 verticalAlignment: Qt.AlignCenter\r
                                 Layout.margins: Style.accountDropDownCaretMargin\r
-                                source: "qrc:///client/theme/white/caret-down.svg"\r
+                                source:  "image://svgimage-custom-color/caret-down.svg/"\r
                                 sourceSize.width: Style.accountDropDownCaretSize\r
                                 sourceSize.height: Style.accountDropDownCaretSize\r
                                 Accessible.role: Accessible.PopupMenu\r
index bc2bdda585feea46dcc33fcb11a980a3e6ad20e3..762a9cc3e4e77d83ba495003548be6163e617c8d 100644 (file)
@@ -165,11 +165,11 @@ OCC::Activity Activity::fromActivityJson(const QJsonObject &json, const AccountP
 
     if(!previewsData.isEmpty()) {
         if(activity._icon.contains(QStringLiteral("add-color.svg"))) {
-            activity._icon = "qrc:///client/theme/colored/add-bordered.svg";
-        } else if(activity._icon.contains(QStringLiteral("delete-color.svg"))) {
-            activity._icon = "qrc:///client/theme/colored/delete-bordered.svg";
+            activity._icon = "image://svgimage-custom-color/add.svg";
+        } else if(activity._icon.contains(QStringLiteral("delete.svg"))) {
+            activity._icon = "image://svgimage-custom-color/delete.svg";
         } else if(activity._icon.contains(QStringLiteral("change.svg"))) {
-            activity._icon = "qrc:///client/theme/colored/change-bordered.svg";
+            activity._icon = "image://svgimage-custom-color/change.svg";
         }
     }
 
index 61c05b8d8c796f508d5ec9f58f5afd945e82edf5..463aea390a1d4aac7f887e56e77970542acf4cb4 100644 (file)
@@ -226,9 +226,9 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const
     };
 
     const auto generateIconPath = [&]() {
-        auto colorIconPath = role == DarkIconRole ? QStringLiteral("qrc:///client/theme/white/") : QStringLiteral("qrc:///client/theme/black/");
+        auto colorIconPath = QStringLiteral("image://svgimage-custom-color/");//role == DarkIconRole ? QStringLiteral("qrc:///client/theme/white/") : QStringLiteral("qrc:///client/theme/black/");
         if (a._type == Activity::NotificationType && !a._talkNotificationData.userAvatar.isEmpty()) {
-            return QStringLiteral("qrc:///client/theme/colored/talk-bordered.svg");
+            return QStringLiteral("image://svgimage-custom-color/talk-bordered.svg");
         } else if (a._type == Activity::SyncResultType) {
             colorIconPath.append("state-error.svg");
             return colorIconPath;
@@ -254,14 +254,14 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const
             } else {
                 // File sync successful
                 if (a._fileAction == "file_created") {
-                    return a._previews.empty() ? QStringLiteral("qrc:///client/theme/colored/add.svg")
-                                               : QStringLiteral("qrc:///client/theme/colored/add-bordered.svg");
+                    return a._previews.empty() ? QStringLiteral("image://svgimage-custom-color/add.svg")
+                                               : QStringLiteral("image://svgimage-custom-color/add-bordered.svg");
                 } else if (a._fileAction == "file_deleted") {
-                    return a._previews.empty() ? QStringLiteral("qrc:///client/theme/colored/delete.svg")
-                                               : QStringLiteral("qrc:///client/theme/colored/delete-bordered.svg");
+                    return a._previews.empty() ? QStringLiteral("image://svgimage-custom-color/delete.svg")
+                                               : QStringLiteral("image://svgimage-custom-color/delete-bordered.svg");
                 } else {
                     return a._previews.empty() ? colorIconPath % QStringLiteral("change.svg")
-                                               : QStringLiteral("qrc:///client/theme/colored/change-bordered.svg");
+                                               : QStringLiteral("image://svgimage-custom-color/change-bordered.svg");
                 }
             }
         } else {
@@ -511,7 +511,7 @@ void ActivityListModel::insertOrRemoveDummyFetchingActivity()
         _dummyFetchingActivities._objectType = dummyFetchingActivityObjectType;
         _dummyFetchingActivities._subject = tr("Fetching activities …");
         _dummyFetchingActivities._dateTime = QDateTime::currentDateTime();
-        _dummyFetchingActivities._icon = QLatin1String("qrc:///client/theme/colored/change-bordered.svg");
+        _dummyFetchingActivities._icon = QLatin1String("image://svgimage-custom-color/change-bordered.svg");
 
         addEntriesToActivityList({_dummyFetchingActivities});
     } else if (!_finalList.isEmpty() && _finalList.first()._objectType == dummyFetchingActivityObjectType) {