Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tapping messages, fix pressandhold/doubletap on touch #1022

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions resources/qml/MessageView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Item {
id: row

property var model
property int buttonSize: Settings.mobileMode? 22 : 16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before they should have been implicitly dependent on whatever is bigger, font size or button size. Can you maybe make this Math.max(fontMetrics.lineHeight, 16) * 1.5 or so?


spacing: messageActions.padding

Expand All @@ -95,6 +96,7 @@ Item {

Layout.preferredHeight: fontMetrics.height
font.family: Settings.emojiFont
font.pointSize: fontMetrics.font.pointSize*(Settings.mobileMode? 1.5 : 1)

text: modelData
onClicked: {
Expand All @@ -109,7 +111,8 @@ Item {

visible: !!row.model && row.model.isEditable
buttonTextColor: Nheko.colors.buttonText
width: 16
width: row.buttonSize
height: row.buttonSize
hoverEnabled: true
image: ":/icons/icons/ui/edit.svg"
ToolTip.visible: hovered
Expand All @@ -126,7 +129,8 @@ Item {
id: reactButton

visible: chat.model ? chat.model.permissions.canSend(MtxEvent.Reaction) : false
width: 16
width: row.buttonSize
height: row.buttonSize
hoverEnabled: true
image: ":/icons/icons/ui/smile.svg"
ToolTip.visible: hovered
Expand All @@ -143,7 +147,8 @@ Item {
id: replyButton

visible: chat.model ? chat.model.permissions.canSend(MtxEvent.TextMessage) : false
width: 16
width: row.buttonSize
height: row.buttonSize
hoverEnabled: true
image: ":/icons/icons/ui/reply.svg"
ToolTip.visible: hovered
Expand All @@ -155,7 +160,8 @@ Item {
ImageButton {
id: optionsButton

width: 16
width: row.buttonSize
height: row.buttonSize
hoverEnabled: true
image: ":/icons/icons/ui/options.svg"
ToolTip.visible: hovered
Expand Down Expand Up @@ -472,6 +478,19 @@ Item {
}
}
}
onPressAndHold: {
messageActions.attached = timelinerow;
messageActions.model = timelinerow;
}
onActiveFocusChanged: {
messageActions.attached = null
messageActions.model = null
}
onPressed: {
messageActions.attached = null
messageActions.model = null
}

background: Rectangle {
id: scrollHighlight

Expand Down
2 changes: 0 additions & 2 deletions resources/qml/TimelineRow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ AbstractButton {
}
}


onPressAndHold: messageContextMenu.show(eventId, type, isSender, isEncrypted, isEditable, contentItem.child.hoveredLink, contentItem.child.copyText)
onDoubleClicked: chat.model.reply = eventId

DragHandler {
Expand Down