From: Claudio Cambra Date: Fri, 19 May 2023 14:38:30 +0000 (+0800) Subject: Respect icon.height and width in custom button contents X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~10^2~26^2~18 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=29ddf1a86da38262f36a370001008198ad255ea3;p=nextcloud-desktop.git Respect icon.height and width in custom button contents Signed-off-by: Claudio Cambra --- diff --git a/src/gui/tray/CustomButton.qml b/src/gui/tray/CustomButton.qml index 08ae77e97..e7a4fd6c7 100644 --- a/src/gui/tray/CustomButton.qml +++ b/src/gui/tray/CustomButton.qml @@ -56,6 +56,8 @@ Button { hovered: root.hovered imageSourceHover: root.imageSourceHover imageSource: root.icon.source + imageSourceWidth: root.icon.width + imageSourceHeight: root.icon.height text: root.text textColor: root.textColor textColorHovered: root.textColorHovered diff --git a/src/gui/tray/NCButtonContents.qml b/src/gui/tray/NCButtonContents.qml index 4247481b6..a2f0afb79 100644 --- a/src/gui/tray/NCButtonContents.qml +++ b/src/gui/tray/NCButtonContents.qml @@ -24,6 +24,8 @@ RowLayout { property bool hovered: false property string imageSourceHover: "" property string imageSource: "" + property int imageSourceWidth: 64 + property int imageSourceHeight: 64 property string text: "" property var display @@ -38,6 +40,12 @@ RowLayout { Layout.maximumHeight: root.height source: root.hovered ? root.imageSourceHover : root.imageSource + + sourceSize { + width: root.imageSourceWidth + height: root.imageSourceHeight + } + fillMode: Image.PreserveAspectFit horizontalAlignment: Image.AlignHCenter verticalAlignment: Image.AlignVCenter