aboutsummaryrefslogtreecommitdiff
path: root/modules/system/quickshell/PopupCard.qml
blob: d4d609bea38a171accbc2c2af222166c6ec06de2 (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
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

Squircle {
    id: root

    property int maxHeight: 440
    property int margins: 16
    default property alias content: contentCol.data

    width: 320
    height: Math.min(Math.max(contentCol.implicitHeight + 2 * margins, 80), maxHeight)

    Behavior on height {
        SpringAnimation {
            spring: 3
            damping: 0.25
        }
    }

    fillColor: Theme.bg
    strokeColor: Theme.border
    strokeWidth: 1
    cornerRadius: 20
    clip: true

    ScrollView {
        anchors {
            fill: parent
            margins: root.margins
        }
        clip: true
        contentWidth: availableWidth
        ScrollBar.vertical.policy: contentCol.implicitHeight > height ? ScrollBar.AsNeeded : ScrollBar.AlwaysOff

        ColumnLayout {
            id: contentCol
            width: parent.width
            spacing: 12
        }
    }
}