Repository: nextcloud/desktop (C++)

Issue:
[Bug]: macOS dark mode: wrong color for icons in active file interaction list
### Bug description

macOS 15.1.1
Nextcloud Desktop 3.14.3

![Image](https://github.com/user-attachments/assets/06f6c44e-7451-40ae-b06e-99f7f19d2315)

Currently: black icons

Expected: white icons

### Steps to reproduce

open file list.

### Expected behavior

White icons

### Which files are affected by this bug

all

### Operating system

macOS

### Which version of the operating system you are running.

15.1.1

### Package

Official macOS 12+ universal pkg

### Nextcloud Server version

29.0.5

### Nextcloud Desktop Client version

3.14.3

### Is this bug present after an update or on a fresh install?

Updated from a minor version (ex. 3.4.2 to 3.4.4)


Discussion: Resolved in 3.15.0:

![Image](https://github.com/user-attachments/assets/7080ac25-c684-449e-8279-d06afd8aa94f)

Remaining inconsistency filed as: https://github.com/nextcloud/desktop/issues/7569




Fix (patch):
diff --git a/src/gui/tray/ActivityItemContent.qml b/src/gui/tray/ActivityItemContent.qml
index 98ea3c2277f04..92d4ed5838b6f 100644
--- a/src/gui/tray/ActivityItemContent.qml
+++ b/src/gui/tray/ActivityItemContent.qml
@@ -104,7 +104,7 @@ RowLayout {
 
             cache: true
             fillMode: Image.PreserveAspectFit
-            source: Style.darkMode ? model.darkIcon : model.lightIcon
+            source: model.icon + "/" + palette.text
             sourceSize.height: 64
             sourceSize.width: 64
             mipmap: true // Addresses grainy downscale
diff --git a/src/gui/tray/activitylistmodel.cpp b/src/gui/tray/activitylistmodel.cpp
index 47cc441f6c14f..65de2e91d7533 100644
--- a/src/gui/tray/activitylistmodel.cpp
+++ b/src/gui/tray/activitylistmodel.cpp
@@ -65,8 +65,7 @@ QHash<int, QByteArray> ActivityListModel::roleNames() const
     roles[LinkRole] = "link";
     roles[MessageRole] = "message";
     roles[ActionRole] = "type";
-    roles[DarkIconRole] = "darkIcon";
-    roles[LightIconRole] = "lightIcon";
+    roles[IconRole] = "icon";
     roles[ActionTextRole] = "subject";
     roles[ActionsLinksRole] = "links";
     roles[ActionsLinksContextMenuRole] = "linksContextMenu";
@@ -226,7 +225,7 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const
     };
 
     const auto generateIconPath = [&]() {
-        auto colorIconPath = role == DarkIconRole ? QStringLiteral("image://svgimage-custom-color/%1/white") : QStringLiteral("image://svgimage-custom-color/%1/black");
+        auto colorIconPath = QStringLiteral("image://svgimage-custom-color/%1");
         if (a._type == Activity::NotificationType && !a._talkNotificationData.userAvatar.isEmpty()) {
             return QStringLiteral("image://svgimage-custom-color/talk-bordered.svg");
         } else if (a._type == Activity::SyncResultType) {
@@ -250,24 +249,16 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const
             } else {
                 // File sync successful
                 if (a._fileAction == "file_created") {
-                    return a._previews.empty() ? QStringLiteral("image://svgimage-custom-color/add.svg/")
-                                               : QStringLiteral("image://svgimage-custom-color/add-bordered.svg/");
+                    return a._previews.empty() ? colorIconPath.arg("add.svg") : colorIconPath.arg("add-bordered.svg");
                 } else if (a._fileAction == "file_deleted") {
-                    return a._previews.empty() ? QStringLiteral("image://svgimage-custom-color/delete.svg/")
-                                               : QStringLiteral("image://svgimage-custom-color/delete-bordered.svg/");
+                    return a._previews.empty() ? colorIconPath.arg("delete.svg") : colorIconPath.arg("delete-bordered.svg");
                 } else {
-                    return a._previews.empty() ? colorIconPath.arg(QStringLiteral("change.svg"))
-                                               : QStringLiteral("image://svgimage-custom-color/change-bordered.svg/");
+                    return a._previews.empty() ? colorIconPath.arg("change.svg") : colorIconPath.arg("change-bordered.svg");
                 }
             }
         } else {
             // We have an activity
-            if (a._icon.isEmpty()) {
-                return colorIconPath.arg("activity.svg");
-            }
-
-            const QString basePath = QStringLiteral("image://tray-image-provider/") % a._icon % QStringLiteral("/");
-            return role == DarkIconRole ? QString(basePath + QStringLiteral("white")) : QString(basePath + QStringLiteral("black"));
+            return a._icon.isEmpty() ? colorIconPath.arg("activity.svg") : colorIconPath.arg(a._icon);
         }
     };
 
@@ -296,10 +287,8 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const
         return ActivityListModel::convertLinksToActionButtons(a);
     }
 
-    case DarkIconRole:
-    case LightIconRole: {
+    case IconRole:
         return generateIconPath();
-    }
     case ObjectTypeRole:
         return a._objectType;
     case ObjectIdRole:
diff --git a/src/gui/tray/activitylistmodel.h b/src/gui/tray/activitylistmodel.h
index 6251a12e9a1ff..e8e4ed5bb93e0 100644
--- a/src/gui/tray/activitylistmodel.h
+++ b/src/gui/tray/activitylistmodel.h
@@ -51,8 +51,7 @@ class ActivityListModel : public QAbstractListModel
 
 public:
     enum DataRole {
-        DarkIconRole = Qt::UserRole + 1,
-        LightIconRole,
+        IconRole = Qt::UserRole + 1,
         AccountRole,
         ObjectTypeRole,
         ObjectIdRole,