diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2025-09-10 15:57:26 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2025-09-10 15:57:26 +0200 |
| commit | d20393e077b8d97b18f4a224ddcb20caf6dac23b (patch) | |
| tree | 337a8630deecdb50a2c879754e6b34b71575bbe0 /accounts/gkleen@sif/shell/quickshell/MaterialDesignIcon.qml | |
| parent | 9fab3828698199718a3d2f2faf8826f77d9258f7 (diff) | |
| download | nixos-d20393e077b8d97b18f4a224ddcb20caf6dac23b.tar nixos-d20393e077b8d97b18f4a224ddcb20caf6dac23b.tar.gz nixos-d20393e077b8d97b18f4a224ddcb20caf6dac23b.tar.bz2 nixos-d20393e077b8d97b18f4a224ddcb20caf6dac23b.tar.xz nixos-d20393e077b8d97b18f4a224ddcb20caf6dac23b.zip | |
...
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell/MaterialDesignIcon.qml')
| -rw-r--r-- | accounts/gkleen@sif/shell/quickshell/MaterialDesignIcon.qml | 17 |
1 files changed, 14 insertions, 3 deletions
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 | |||
| 2 | import QtQuick.Effects | 2 | import QtQuick.Effects |
| 3 | 3 | ||
| 4 | Item { | 4 | Item { |
| 5 | id: icon | 5 | id: root |
| 6 | 6 | ||
| 7 | required property string icon | 7 | required property string icon |
| 8 | property color color: "white" | 8 | property color color: "white" |
| 9 | 9 | ||
| 10 | property real implicitSize: 0 | ||
| 11 | |||
| 12 | readonly property real actualSize: Math.min(root.width, root.height) | ||
| 13 | |||
| 14 | implicitWidth: root.implicitSize | ||
| 15 | implicitHeight: root.implicitSize | ||
| 16 | |||
| 10 | Image { | 17 | Image { |
| 11 | id: sourceImage | 18 | id: sourceImage |
| 12 | source: "file://" + @mdi@ + "/svg/" + icon.icon + ".svg" | 19 | source: "file://" + @mdi@ + "/svg/" + root.icon + ".svg" |
| 13 | anchors.fill: parent | 20 | anchors.fill: parent |
| 21 | fillMode: Image.PreserveAspectFit | ||
| 22 | |||
| 23 | sourceSize.width: root.actualSize | ||
| 24 | sourceSize.height: root.actualSize | ||
| 14 | 25 | ||
| 15 | layer.enabled: true | 26 | layer.enabled: true |
| 16 | layer.effect: MultiEffect { | 27 | layer.effect: MultiEffect { |
| @@ -18,7 +29,7 @@ Item { | |||
| 18 | 29 | ||
| 19 | brightness: 1 | 30 | brightness: 1 |
| 20 | colorization: 1 | 31 | colorization: 1 |
| 21 | colorizationColor: icon.color | 32 | colorizationColor: root.color |
| 22 | } | 33 | } |
| 23 | } | 34 | } |
| 24 | } | 35 | } |
