aboutsummaryrefslogtreecommitdiff
path: root/modules/system/quickshell/IconCircle.qml
blob: 50d5dd66c676567306185dc3d453797f5e72bbb5 (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
36
37
38
import QtQuick
import QtQuick.Effects
import Quickshell

Rectangle {
    id: root
    
    property string source: ""
    property bool active: false
    property real size: 24

    width: size
    height: size
    radius: size / 2
    color: active ? Theme.accent : Theme.surfaceLighter

    Image {
        id: iconImage
        anchors.centerIn: parent
        width: parent.width * 0.6
        height: parent.height * 0.6
        source: Quickshell.iconPath(root.source.endsWith("-symbolic") ? root.source : root.source + "-symbolic")
        sourceSize: Qt.size(width, height)
        smooth: true
        mipmap: true
        
        visible: false 
    }

    MultiEffect {
        anchors.fill: iconImage
        source: iconImage
        colorizationColor: "#FFFFFF"
        colorization: 1.0
        
        opacity: root.active ? 1.0 : 0.6
    }
}