mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Improve hover stuff, needs HoverHandler for a proper fix
This commit is contained in:
parent
6a0de004a2
commit
bcfa683468
2 changed files with 11 additions and 8 deletions
|
@ -11,15 +11,23 @@ Item {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
height: row.height
|
height: row.height
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
color: (Settings.messageHoverHighlight && hoverHandler.containsMouse) ? colors.alternateBase : "transparent"
|
||||||
|
anchors.fill: row
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
id: hoverHandler
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
propagateComposedEvents: true
|
propagateComposedEvents: true
|
||||||
preventStealing: true
|
preventStealing: false
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
acceptedButtons: Qt.AllButtons
|
acceptedButtons: Qt.AllButtons
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (mouse.button === Qt.RightButton)
|
if (mouse.button === Qt.RightButton)
|
||||||
messageContextMenu.show(model.id, model.type, model.isEncrypted, row);
|
messageContextMenu.show(model.id, model.type, model.isEncrypted, row);
|
||||||
|
else
|
||||||
|
event.accepted = false
|
||||||
|
|
||||||
}
|
}
|
||||||
onPressAndHold: {
|
onPressAndHold: {
|
||||||
|
@ -27,11 +35,6 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
color: (Settings.messageHoverHighlight && parent.containsMouse) ? colors.base : "transparent"
|
|
||||||
anchors.fill: row
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: row
|
id: row
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ Item {
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
preventStealing: true
|
preventStealing: false
|
||||||
onClicked: chat.positionViewAtIndex(chat.model.idToIndex(modelData.id), ListView.Contain)
|
onClicked: chat.positionViewAtIndex(chat.model.idToIndex(modelData.id), ListView.Contain)
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue