Skip to content
Snippets Groups Projects
Commit fc47af42 authored by Prince Gupta's avatar Prince Gupta :speech_balloon: Committed by Pierre Lamot
Browse files

qml: show separators between items in KeyNavigableTableView

parent 58c0d38c
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,10 @@ NavigableFocusScope {
view.positionViewAtIndex(index, mode)
}
function itemAtIndex(index) {
return view.itemAtIndex(index)
}
Component {
id: sectionHeading
......
......@@ -170,12 +170,20 @@ NavigableFocusScope {
property var rowModel: model
property bool selected: selectionModel.isSelected(root.model.index(index, 0))
property alias showSeparator: separator.visible
readonly property bool highlighted: selected || hoverArea.containsMouse || activeFocus
width: view.width
height: root.rowHeight
color: highlighted ? VLCStyle.colors.bgHover : "transparent"
onHighlightedChanged: {
showSeparator = !highlighted
var nextItem = view.itemAtIndex(index + 1)
if ( nextItem && lineView.ListView.nextSection === lineView.ListView.section)
nextItem.showSeparator = !highlighted && !nextItem.highlighted
}
Connections {
target: selectionModel
onSelectionChanged: lineView.selected = selectionModel.isSelected(root.model.index(index, 0))
......@@ -202,7 +210,20 @@ NavigableFocusScope {
actionForSelection(selectionModel.selectedIndexes)
}
Rectangle {
id: separator
anchors.top: parent.top
anchors.right: content.right
width: content.width + (lineView.ListView.previousSection !== lineView.ListView.section
? VLCStyle.table_section_width : 0)
height: VLCStyle.heightBar_xxxsmall
color: VLCStyle.colors.separator
}
Row {
id: content
anchors {
topMargin: VLCStyle.margin_xxsmall
bottomMargin: VLCStyle.margin_xxsmall
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment