PlasmaComponents.ListView already provides onClicked and containsMouse

It does not provide onEntered/onExited but we can mimic that with onContainsMouseChanged
This removes the MouseArea which could never occupy the entire highlight area due to theme
margins leading to annoying flickering when moving between items because the one MouseArea
was exited before the next one was entered
wilder-5.14
Kai Uwe Broulik 12 years ago
parent 798721d866
commit d33fc022c8
  1. 15
      applets/clipboard/contents/ui/ClipboardItemDelegate.qml

@ -38,14 +38,16 @@ PlasmaComponents.ListItem {
x: -listMargins.left
MouseArea {
anchors.fill: parent
hoverEnabled: true
enabled: true
onClicked: menuItem.itemSelected(UuidRole)
onEntered: menuListView.currentIndex = index
onExited: menuListView.currentIndex = -1
onContainsMouseChanged: {
if (containsMouse) {
menuListView.currentIndex = index
} else {
menuListView.currentIndex = -1
}
}
Item {
id: label
@ -217,4 +219,3 @@ PlasmaComponents.ListItem {
}
}
}
}

Loading…
Cancel
Save