summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/shell/quickshell/MaterialDesignIcon.qml
blob: 155a009e0c5b62b39605bd81c1c6eb417d88c016 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import QtQuick
import QtQuick.Effects

Item {
  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/" + root.icon + ".svg"
    anchors.fill: parent
    fillMode: Image.PreserveAspectFit

    sourceSize.width: root.actualSize
    sourceSize.height: root.actualSize

    layer.enabled: true
    layer.effect: MultiEffect {
      id: effect

      brightness: 1
      colorization: 1
      colorizationColor: root.color
    }
  }
}