aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/macos/TreeViewDelegate.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols/macos/TreeViewDelegate.qml')
-rw-r--r--src/quickcontrols/macos/TreeViewDelegate.qml25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/quickcontrols/macos/TreeViewDelegate.qml b/src/quickcontrols/macos/TreeViewDelegate.qml
new file mode 100644
index 0000000000..b88c43b6be
--- /dev/null
+++ b/src/quickcontrols/macos/TreeViewDelegate.qml
@@ -0,0 +1,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
+ }
+}
+