Fix hovering messages
This commit is contained in:
parent
e077bdbdd5
commit
d330fdb61f
@ -360,7 +360,7 @@ ScrollView {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: Item {
|
delegate: ItemDelegate {
|
||||||
id: wrapper
|
id: wrapper
|
||||||
|
|
||||||
required property double proportionalHeight
|
required property double proportionalHeight
|
||||||
@ -404,12 +404,11 @@ ScrollView {
|
|||||||
width: chat.delegateMaxWidth
|
width: chat.delegateMaxWidth
|
||||||
height: section.active ? section.height + timelinerow.height : timelinerow.height
|
height: section.active ? section.height + timelinerow.height : timelinerow.height
|
||||||
|
|
||||||
Rectangle {
|
background: Rectangle {
|
||||||
id: scrollHighlight
|
id: scrollHighlight
|
||||||
|
|
||||||
opacity: 0
|
opacity: 0
|
||||||
visible: true
|
visible: true
|
||||||
anchors.fill: timelinerow
|
|
||||||
color: Nheko.colors.highlight
|
color: Nheko.colors.highlight
|
||||||
|
|
||||||
states: State {
|
states: State {
|
||||||
@ -474,7 +473,7 @@ ScrollView {
|
|||||||
TimelineRow {
|
TimelineRow {
|
||||||
id: timelinerow
|
id: timelinerow
|
||||||
|
|
||||||
property alias hovered: hoverHandler.hovered
|
hovered: wrapper.hovered
|
||||||
|
|
||||||
proportionalHeight: wrapper.proportionalHeight
|
proportionalHeight: wrapper.proportionalHeight
|
||||||
type: chat.model, wrapper.type
|
type: chat.model, wrapper.type
|
||||||
@ -507,22 +506,16 @@ ScrollView {
|
|||||||
status: wrapper.status
|
status: wrapper.status
|
||||||
relatedEventCacheBuster: wrapper.relatedEventCacheBuster
|
relatedEventCacheBuster: wrapper.relatedEventCacheBuster
|
||||||
y: section.visible && section.active ? section.y + section.height : 0
|
y: section.visible && section.active ? section.y + section.height : 0
|
||||||
|
}
|
||||||
|
|
||||||
HoverHandler {
|
|
||||||
id: hoverHandler
|
|
||||||
|
|
||||||
enabled: !Settings.mobileMode
|
|
||||||
onHoveredChanged: {
|
onHoveredChanged: {
|
||||||
if (hovered) {
|
if (!Settings.mobileMode && hovered) {
|
||||||
if (!messageActionHover.hovered) {
|
if (!messageActionHover.hovered) {
|
||||||
messageActions.attached = timelinerow;
|
messageActions.attached = timelinerow;
|
||||||
messageActions.model = timelinerow;
|
messageActions.model = timelinerow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
function onMovementEnded() {
|
function onMovementEnded() {
|
||||||
|
@ -45,20 +45,16 @@ Item {
|
|||||||
required property int status
|
required property int status
|
||||||
required property int relatedEventCacheBuster
|
required property int relatedEventCacheBuster
|
||||||
|
|
||||||
|
property bool hovered: false
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: (Settings.messageHoverHighlight && hoverHandler.hovered) ? Nheko.colors.alternateBase : "transparent"
|
color: (Settings.messageHoverHighlight && hovered) ? Nheko.colors.alternateBase : "transparent"
|
||||||
anchors.fill: row
|
anchors.fill: row
|
||||||
}
|
}
|
||||||
|
|
||||||
HoverHandler {
|
|
||||||
id: hoverHandler
|
|
||||||
|
|
||||||
acceptedDevices: PointerDevice.GenericPointer
|
|
||||||
}
|
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
acceptedButtons: Qt.RightButton
|
acceptedButtons: Qt.RightButton
|
||||||
onSingleTapped: messageContextMenu.show(eventId, type, isSender, isEncrypted, isEditable, contentItem.child.hoveredLink, contentItem.child.copyText)
|
onSingleTapped: messageContextMenu.show(eventId, type, isSender, isEncrypted, isEditable, contentItem.child.hoveredLink, contentItem.child.copyText)
|
||||||
|
Loading…
Reference in New Issue
Block a user