Improve hover stuff, needs HoverHandler for a proper fix

This commit is contained in:
Nicolas Werner 2021-01-18 20:49:40 +01:00
parent 6a0de004a2
commit bcfa683468
2 changed files with 11 additions and 8 deletions

View File

@ -11,15 +11,23 @@ Item {
anchors.right: parent.right
height: row.height
Rectangle {
color: (Settings.messageHoverHighlight && hoverHandler.containsMouse) ? colors.alternateBase : "transparent"
anchors.fill: row
}
MouseArea {
id: hoverHandler
anchors.fill: parent
propagateComposedEvents: true
preventStealing: true
preventStealing: false
hoverEnabled: true
acceptedButtons: Qt.AllButtons
onClicked: {
if (mouse.button === Qt.RightButton)
messageContextMenu.show(model.id, model.type, model.isEncrypted, row);
else
event.accepted = false
}
onPressAndHold: {
@ -27,11 +35,6 @@ Item {
}
}
Rectangle {
color: (Settings.messageHoverHighlight && parent.containsMouse) ? colors.base : "transparent"
anchors.fill: row
}
RowLayout {
id: row

View File

@ -15,7 +15,7 @@ Item {
MouseArea {
anchors.fill: parent
preventStealing: true
preventStealing: false
onClicked: chat.positionViewAtIndex(chat.model.idToIndex(modelData.id), ListView.Contain)
cursorShape: Qt.PointingHandCursor
}