From d20393e077b8d97b18f4a224ddcb20caf6dac23b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 10 Sep 2025 15:57:26 +0200 Subject: ... --- .../gkleen@sif/shell/quickshell/MaterialDesignIcon.qml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'accounts/gkleen@sif/shell/quickshell/MaterialDesignIcon.qml') diff --git a/accounts/gkleen@sif/shell/quickshell/MaterialDesignIcon.qml b/accounts/gkleen@sif/shell/quickshell/MaterialDesignIcon.qml index 387dcc8b..155a009e 100644 --- a/accounts/gkleen@sif/shell/quickshell/MaterialDesignIcon.qml +++ b/accounts/gkleen@sif/shell/quickshell/MaterialDesignIcon.qml @@ -2,15 +2,26 @@ import QtQuick import QtQuick.Effects Item { - id: icon + id: root required property string icon property color color: "white" + property real implicitSize: 0 + + readonly property real actualSize: Math.min(root.width, root.height) + + implicitWidth: root.implicitSize + implicitHeight: root.implicitSize + Image { id: sourceImage - source: "file://" + @mdi@ + "/svg/" + icon.icon + ".svg" + source: "file://" + @mdi@ + "/svg/" + root.icon + ".svg" anchors.fill: parent + fillMode: Image.PreserveAspectFit + + sourceSize.width: root.actualSize + sourceSize.height: root.actualSize layer.enabled: true layer.effect: MultiEffect { @@ -18,7 +29,7 @@ Item { brightness: 1 colorization: 1 - colorizationColor: icon.color + colorizationColor: root.color } } } -- cgit v1.2.3