Skip to content

Commit

Permalink
Fix review comments.
Browse files Browse the repository at this point in the history
Signed-off-by: alex-z <[email protected]>
  • Loading branch information
allexzander authored and mgallien committed Oct 6, 2023
1 parent 7f58be4 commit cedcc0c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 28 deletions.
29 changes: 5 additions & 24 deletions src/gui/tray/NCIconWithBackgroundImage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,7 +31,6 @@ Item {

cache: true
mipmap: true

fillMode: Image.PreserveAspectFit
visible: source !== ""
}
Expand Down
11 changes: 7 additions & 4 deletions src/gui/tray/TrayFolderListItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -64,7 +64,10 @@ MenuItem {

spacing: Style.extraSmallSpacing

Layout.alignment: Qt.AlignVCenter

Layout.fillWidth: true

}
}
}

0 comments on commit cedcc0c

Please sign in to comment.