diff --git a/resources.qrc b/resources.qrc
index afe9e7836f046..fc65956940bf4 100644
--- a/resources.qrc
+++ b/resources.qrc
@@ -48,6 +48,7 @@
src/gui/tray/CallNotificationDialog.qml
src/gui/tray/EditFileLocallyLoadingDialog.qml
src/gui/tray/NCBusyIndicator.qml
+ src/gui/tray/NCIconWithBackgroundImage.qml
src/gui/tray/NCToolTip.qml
src/gui/tray/NCProgressBar.qml
src/gui/tray/EnforcedPlainTextLabel.qml
diff --git a/src/gui/tray/NCIconWithBackgroundImage.qml b/src/gui/tray/NCIconWithBackgroundImage.qml
new file mode 100644
index 0000000000000..0ef155ad97f20
--- /dev/null
+++ b/src/gui/tray/NCIconWithBackgroundImage.qml
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2023 by Oleksandr Zolotov
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+import QtQuick 2.15
+import Style 1.0
+
+Image {
+ id: root
+
+ property alias icon: icon
+
+ cache: true
+ mipmap: true
+ fillMode: Image.PreserveAspectFit
+
+ Image {
+ id: icon
+
+ anchors.centerIn: parent
+
+ cache: true
+ mipmap: true
+ fillMode: Image.PreserveAspectFit
+ visible: source !== ""
+ }
+}
diff --git a/src/gui/tray/TrayFolderListItem.qml b/src/gui/tray/TrayFolderListItem.qml
index 60fd21570ecb8..b83160bc6d54f 100644
--- a/src/gui/tray/TrayFolderListItem.qml
+++ b/src/gui/tray/TrayFolderListItem.qml
@@ -21,7 +21,8 @@ MenuItem {
id: root
property string subline: ""
- property string iconSource: "image://svgimage-custom-color/folder-group.svg/" + palette.buttonText
+ property string iconSource: "image://svgimage-custom-color/account-group.svg/" + palette.buttonText
+ property string backgroundIconSource: value
property string toolTipText: root.text
NCToolTip {
@@ -45,13 +46,12 @@ MenuItem {
anchors.rightMargin: Style.trayWindowMenuEntriesMargin
spacing: Style.trayHorizontalMargin
- Image {
- source: root.iconSource
- cache: true
- sourceSize.width: root.height * Style.smallIconScaleFactor
- sourceSize.height: root.height * Style.smallIconScaleFactor
- verticalAlignment: Qt.AlignVCenter
- horizontalAlignment: Qt.AlignHCenter
+ NCIconWithBackgroundImage {
+ source: root.backgroundIconSource
+
+ icon.source: root.iconSource
+ icon.height: height * Style.smallIconScaleFactor
+ icon.width: icon.height
Layout.preferredHeight: root.height * Style.smallIconScaleFactor
Layout.preferredWidth: root.height * Style.smallIconScaleFactor
@@ -64,7 +64,10 @@ MenuItem {
spacing: Style.extraSmallSpacing
+ Layout.alignment: Qt.AlignVCenter
+
Layout.fillWidth: true
+
}
}
}
diff --git a/src/gui/tray/TrayFoldersMenuButton.qml b/src/gui/tray/TrayFoldersMenuButton.qml
index 2953ae12ab3ca..1b6d07e189db5 100644
--- a/src/gui/tray/TrayFoldersMenuButton.qml
+++ b/src/gui/tray/TrayFoldersMenuButton.qml
@@ -100,9 +100,14 @@ HeaderButton {
Image {
id: openLocalFolderButtonIcon
- cache: false
+ cache: true
source: "image://svgimage-custom-color/folder.svg/" + Style.currentUserHeaderTextColor
+ sourceSize {
+ width: Style.headerButtonIconSize
+ height: Style.headerButtonIconSize
+ }
+
verticalAlignment: Qt.AlignCenter
Accessible.role: Accessible.Graphic
@@ -185,9 +190,10 @@ HeaderButton {
subline: model.modelData.parentPath
width: foldersMenuListView.width
height: Style.standardPrimaryButtonHeight
- iconSource: !isGroupFolder ?
- "image://svgimage-custom-color/folder.svg/" + palette.buttonText :
- "image://svgimage-custom-color/folder-group.svg/" + palette.buttonText
+ backgroundIconSource: "image://svgimage-custom-color/folder.svg/" + palette.buttonText
+ iconSource: isGroupFolder
+ ? "image://svgimage-custom-color/account-group.svg/" + palette.brightText
+ : ""
onTriggered: {
foldersMenu.close();
diff --git a/theme.qrc.in b/theme.qrc.in
index 60f25c4fca1ba..e8d88fc8a1b0c 100644
--- a/theme.qrc.in
+++ b/theme.qrc.in
@@ -44,6 +44,7 @@
theme/white/state-sync-64.png
theme/white/state-sync-128.png
theme/white/state-sync-256.png
+ theme/black/account-group.svg
theme/black/change.svg
theme/black/clear.svg
theme/black/comment.svg
diff --git a/theme/black/account-group.svg b/theme/black/account-group.svg
new file mode 100644
index 0000000000000..01159f5f68aeb
--- /dev/null
+++ b/theme/black/account-group.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/theme/black/folder.svg b/theme/black/folder.svg
index 9289fb05d74ce..bc31144b67784 100644
--- a/theme/black/folder.svg
+++ b/theme/black/folder.svg
@@ -1 +1 @@
-
+
\ No newline at end of file
diff --git a/theme/white/folder.svg b/theme/white/folder.svg
index a32ffc8570c2b..f0f077be560fa 100644
--- a/theme/white/folder.svg
+++ b/theme/white/folder.svg
@@ -1 +1 @@
-
+
\ No newline at end of file