ListViewHighlight.qml 971 Bytes
Newer Older
1
2
3
4
/* SPDX-FileCopyrightText: 2020 Noah Davis <noahadvs@gmail.com>
 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
 */

Noah Davis's avatar
Noah Davis committed
5
import QtQuick 2.15
6
7
import org.kde.kirigami 2.14 as Kirigami

Noah Davis's avatar
Noah Davis committed
8
Kirigami.ShadowedRectangle {
9
    id: root
10
    property int currentIndex: -1
Noah Davis's avatar
Noah Davis committed
11
12
    property int count: 0
    readonly property real topRadius: root.currentIndex == 0 ? Kirigami.Units.smallRadius : 0
13
    readonly property real bottomRadius: root.currentIndex == Math.max(root.count-1, 0) ? Kirigami.Units.smallRadius : 0
14
15
16
17

    Kirigami.Theme.colorSet: Kirigami.Theme.Selection
    Kirigami.Theme.inherit: false

Noah Davis's avatar
Noah Davis committed
18
19
20
21
22
23
    corners {
        topLeftRadius: root.topRadius
        topRightRadius: root.topRadius
        bottomLeftRadius: root.bottomRadius
        bottomRightRadius: root.bottomRadius
    }
24
25
26
27
28
29
30

    color: Kirigami.Theme.alternateBackgroundColor
    border {
        width: Kirigami.Units.smallBorder
        color: Kirigami.Theme.focusColor
    }
}