aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/macos/TreeViewDelegate.qml
blob: b88c43b6be7b64c71868082bf7b15ae1bceb2fc4 (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
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

import QtQuick
import QtQuick.NativeStyle as NativeStyle

NativeStyle.DefaultTreeViewDelegate {
    id: control

    palette.highlight: "#2f64e1"
    palette.highlightedText: "white"

    background: Rectangle {
        color: control.highlighted ? control.palette.highlight
               : (control.treeView.alternatingRows && control.row % 2 !== 0
               ? control.palette.alternateBase : control.palette.base)
        // Ideally we want a rounded background for the whole row, also when
        // there are more than one column. But until Rectangle gains support
        // for corners with individual radii, we simplify it (QTBUG-48774)
        radius: control.row === control.treeView.currentRow && control.treeView.columns === 1 ? 5 : 0

        readonly property bool __ignoreNotCustomizable: true
    }
}