summaryrefslogtreecommitdiff
path: root/components/SimpleResource.qml
blob: 6dc2bba82b05c572be285b5bba5a5196d168559a (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import QtQuick
import Quickshell
import QtQuick.Layouts
import qs.config as Config
import qs.components

Item {
    id: root

    required property string text
    required property string icon

    implicitWidth: container.implicitWidth
    implicitHeight: container.implicitHeight

    Rectangle {
        id: container
        anchors {
            fill: parent
            verticalCenter: parent.verticalCenter
            horizontalCenter: parent.horizontalCenter
        }
        implicitWidth: layout.implicitWidth + Config.General.rectMargin * 2
        implicitHeight: Config.Bar.height - Config.General.rectMargin

        color: Config.Colors.alt
        radius: Config.Style.rounding.large

        RowLayout {
            id: layout

            anchors {
                verticalCenter: parent.verticalCenter
                horizontalCenter: parent.horizontalCenter
            }

            spacing: Config.Bar.resourceIconTextSpacing

            Icons {
                text: root.icon
            }
            Text {
                text: root.text
            }

            Item {
                Layout.fillWidth: true
                Layout.fillHeight: true
            }
        }
    }
}