mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-24 03:58:49 +03:00
messageActions onPressAndHold
This commit is contained in:
parent
a100a5b2f0
commit
24970b889e
2 changed files with 23 additions and 6 deletions
|
@ -82,6 +82,7 @@ Item {
|
||||||
id: row
|
id: row
|
||||||
|
|
||||||
property var model
|
property var model
|
||||||
|
property int buttonSize: Settings.mobileMode? 22 : 16
|
||||||
|
|
||||||
spacing: messageActions.padding
|
spacing: messageActions.padding
|
||||||
|
|
||||||
|
@ -95,6 +96,7 @@ Item {
|
||||||
|
|
||||||
Layout.preferredHeight: fontMetrics.height
|
Layout.preferredHeight: fontMetrics.height
|
||||||
font.family: Settings.emojiFont
|
font.family: Settings.emojiFont
|
||||||
|
font.pointSize: fontMetrics.font.pointSize*(Settings.mobileMode? 1.5 : 1)
|
||||||
|
|
||||||
text: modelData
|
text: modelData
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
@ -109,7 +111,8 @@ Item {
|
||||||
|
|
||||||
visible: !!row.model && row.model.isEditable
|
visible: !!row.model && row.model.isEditable
|
||||||
buttonTextColor: Nheko.colors.buttonText
|
buttonTextColor: Nheko.colors.buttonText
|
||||||
width: 16
|
width: row.buttonSize
|
||||||
|
height: row.buttonSize
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
image: ":/icons/icons/ui/edit.svg"
|
image: ":/icons/icons/ui/edit.svg"
|
||||||
ToolTip.visible: hovered
|
ToolTip.visible: hovered
|
||||||
|
@ -126,7 +129,8 @@ Item {
|
||||||
id: reactButton
|
id: reactButton
|
||||||
|
|
||||||
visible: chat.model ? chat.model.permissions.canSend(MtxEvent.Reaction) : false
|
visible: chat.model ? chat.model.permissions.canSend(MtxEvent.Reaction) : false
|
||||||
width: 16
|
width: row.buttonSize
|
||||||
|
height: row.buttonSize
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
image: ":/icons/icons/ui/smile.svg"
|
image: ":/icons/icons/ui/smile.svg"
|
||||||
ToolTip.visible: hovered
|
ToolTip.visible: hovered
|
||||||
|
@ -143,7 +147,8 @@ Item {
|
||||||
id: replyButton
|
id: replyButton
|
||||||
|
|
||||||
visible: chat.model ? chat.model.permissions.canSend(MtxEvent.TextMessage) : false
|
visible: chat.model ? chat.model.permissions.canSend(MtxEvent.TextMessage) : false
|
||||||
width: 16
|
width: row.buttonSize
|
||||||
|
height: row.buttonSize
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
image: ":/icons/icons/ui/reply.svg"
|
image: ":/icons/icons/ui/reply.svg"
|
||||||
ToolTip.visible: hovered
|
ToolTip.visible: hovered
|
||||||
|
@ -155,7 +160,8 @@ Item {
|
||||||
ImageButton {
|
ImageButton {
|
||||||
id: optionsButton
|
id: optionsButton
|
||||||
|
|
||||||
width: 16
|
width: row.buttonSize
|
||||||
|
height: row.buttonSize
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
image: ":/icons/icons/ui/options.svg"
|
image: ":/icons/icons/ui/options.svg"
|
||||||
ToolTip.visible: hovered
|
ToolTip.visible: hovered
|
||||||
|
@ -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 {
|
background: Rectangle {
|
||||||
id: scrollHighlight
|
id: scrollHighlight
|
||||||
|
|
||||||
|
|
|
@ -63,8 +63,6 @@ AbstractButton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onPressAndHold: messageContextMenu.show(eventId, type, isSender, isEncrypted, isEditable, contentItem.child.hoveredLink, contentItem.child.copyText)
|
|
||||||
onDoubleClicked: chat.model.reply = eventId
|
onDoubleClicked: chat.model.reply = eventId
|
||||||
|
|
||||||
DragHandler {
|
DragHandler {
|
||||||
|
|
Loading…
Reference in a new issue