iOS style: draw TreeViewDelegate as highlighted

When TreeView has a selection, or a cell that is otherwise
highlighted, the delegate items that are affected should
draw themselves as highlighted..

Pick-to: 6.4
Change-Id: Iefa226bb774c94f22582fae481a0649a3fcf069e
Reviewed-by: Doris Verria <doris.verria@qt.io>
This commit is contained in:
Richard Moe Gustavsen 2022-08-19 11:43:57 +02:00
parent 55fab9a73e
commit 9b4179a98a
1 changed files with 6 additions and 1 deletions

View File

@ -20,6 +20,11 @@ T.TreeViewDelegate {
topPadding: contentItem ? (height - contentItem.implicitHeight) / 2 : 0
leftPadding: !mirrored ? leftMargin + __contentIndent : width - leftMargin - __contentIndent - implicitContentWidth
highlighted: control.selected || control.current
|| ((control.treeView.selectionBehavior === TableView.SelectRows
|| control.treeView.selectionBehavior === TableView.SelectionDisabled)
&& control.row === control.treeView.currentRow)
required property int row
required property var model
readonly property real __contentIndent: !isTreeNode ? 0 : (depth * indentation) + (indicator ? indicator.width + spacing : 0)
@ -54,7 +59,7 @@ T.TreeViewDelegate {
NinePatchImage {
height: parent.height
width: parent.width
source: control.IOS.url + "itemdelegate-background"
source: control.IOS.url + (control.highlighted ? "itemdelegate-background-pressed" : "itemdelegate-background")
NinePatchImageSelector on source {
states: [
{"light": control.IOS.theme === IOS.Light},