From cedcc0c5c541b91820818203164a9c2b18867ef7 Mon Sep 17 00:00:00 2001 From: alex-z Date: Thu, 5 Oct 2023 18:24:49 +0200 Subject: [PATCH] Fix review comments. Signed-off-by: alex-z --- src/gui/tray/NCIconWithBackgroundImage.qml | 29 ++++------------------ src/gui/tray/TrayFolderListItem.qml | 11 +++++--- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/src/gui/tray/NCIconWithBackgroundImage.qml b/src/gui/tray/NCIconWithBackgroundImage.qml index df243d2d1bda6..0ef155ad97f20 100644 --- a/src/gui/tray/NCIconWithBackgroundImage.qml +++ b/src/gui/tray/NCIconWithBackgroundImage.qml @@ -15,32 +15,14 @@ import QtQuick 2.15 import Style 1.0 -Item { +Image { id: root - property alias source: icon.source - property alias sourceSize: icon.sourceSize - property alias backgroundIconSource: backgroundImage.source + property alias icon: icon - implicitWidth: backgroundImage.source !== "" ? backgroundImage.implicitWidth : icon.implicitWidth - implicitHeight: backgroundImage.source !== "" ? backgroundImage.implicitHeight : icon.implicitHeight - - Image { - id: backgroundImage - - anchors.fill: parent - - cache: true - mipmap: true - - sourceSize { - width: root.width - height: root.height - } - - fillMode: Image.PreserveAspectFit - visible: source !== "" - } + cache: true + mipmap: true + fillMode: Image.PreserveAspectFit Image { id: icon @@ -49,7 +31,6 @@ Item { cache: true mipmap: true - fillMode: Image.PreserveAspectFit visible: source !== "" } diff --git a/src/gui/tray/TrayFolderListItem.qml b/src/gui/tray/TrayFolderListItem.qml index e2e08878689b1..b83160bc6d54f 100644 --- a/src/gui/tray/TrayFolderListItem.qml +++ b/src/gui/tray/TrayFolderListItem.qml @@ -47,11 +47,11 @@ MenuItem { spacing: Style.trayHorizontalMargin NCIconWithBackgroundImage { - source: root.iconSource - sourceSize.width: root.height * 0.25 - sourceSize.height: root.height * 0.25 + source: root.backgroundIconSource - backgroundIconSource: 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 + } } }