Skip to content
Snippets Groups Projects
Verified Commit 0a3aeb0a authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Fix timeline menus

parent 1744f38e
No related branches found
No related tags found
No related merge requests found
...@@ -84,9 +84,13 @@ Item { ...@@ -84,9 +84,13 @@ Item {
required property var reactions required property var reactions
required property int status required property int status
required property int trustlevel required property int trustlevel
required property int type
required property bool isEditable
property int avatarMargin: (wrapper.isStateEvent || Settings.smallAvatars ? 0 : (Nheko.avatarSize + 8)) // align bubble with section header property int avatarMargin: (wrapper.isStateEvent || Settings.smallAvatars ? 0 : (Nheko.avatarSize + 8)) // align bubble with section header
property alias hovered: messageHover.hovered
data: [ data: [
Loader { Loader {
id: section id: section
...@@ -109,6 +113,19 @@ Item { ...@@ -109,6 +113,19 @@ Item {
visible: status == Loader.Ready visible: status == Loader.Ready
z: 4 z: 4
}, },
Rectangle {
anchors.fill: gridContainer
color: (Settings.messageHoverHighlight && messageHover.hovered) ? palette.alternateBase : "transparent"
// this looks better without margins
TapHandler {
acceptedButtons: Qt.RightButton
acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad
gesturePolicy: TapHandler.ReleaseWithinBounds
onSingleTapped: messageContextMenu.show(wrapper.eventId, wrapper.threadId, wrapper.type, wrapper.isSender, wrapper.isEncrypted, wrapper.isEditable, wrapper.main.hoveredLink, wrapper.main.copyText)
}
},
RowLayout { RowLayout {
id: gridContainer id: gridContainer
...@@ -276,7 +293,23 @@ Item { ...@@ -276,7 +293,23 @@ Item {
} }
} }
}, },
Item {
id: messageActionsAnchor
anchors.fill: gridContainer
property alias hovered: messageHover.hovered
HoverHandler {
id: messageHover
onHoveredChanged: () => {
if (!Settings.mobileMode && hovered) {
if (!messageActions.hovered) {
messageActions.model = wrapper;
messageActions.attached = wrapper;
messageActions.anchors.bottomMargin = -gridContainer.y
}
}
}
}
},
Reactions { Reactions {
id: reactionRow id: reactionRow
...@@ -346,15 +379,15 @@ Item { ...@@ -346,15 +379,15 @@ Item {
property Item attached: null property Item attached: null
// use comma to update on scroll // use comma to update on scroll
property var attachedPos: chat.contentY, attached ? chat.mapFromItem(attached, attached ? attached.width - width : 0, -height) : null
property alias model: row.model property alias model: row.model
hoverEnabled: true hoverEnabled: true
padding: Nheko.paddingSmall padding: Nheko.paddingSmall
visible: Settings.buttonsInTimeline && !!attached && (attached.hovered || hovered) visible: Settings.buttonsInTimeline && !!attached && (attached.hovered || hovered)
x: attached ? attachedPos.x : 0
y: attached ? attachedPos.y + Nheko.paddingSmall : 0
z: 10 z: 10
parent: chat.contentItem
anchors.bottom: attached?.top
anchors.right: attached?.right
background: Rectangle { background: Rectangle {
border.color: palette.buttonText border.color: palette.buttonText
......
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