Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
5d6c26c8
Unverified
Commit
5d6c26c8
authored
3 years ago
by
Nicolas Werner
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #696 from resolritter/reply
Right-click tap handler for replies
parents
43703c95
3f8bb19b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#1726
passed
3 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
resources/qml/MessageView.qml
+34
-0
34 additions, 0 deletions
resources/qml/MessageView.qml
resources/qml/delegates/Reply.qml
+21
-7
21 additions, 7 deletions
resources/qml/delegates/Reply.qml
resources/qml/delegates/TextMessage.qml
+7
-0
7 additions, 0 deletions
resources/qml/delegates/TextMessage.qml
with
62 additions
and
7 deletions
resources/qml/MessageView.qml
+
34
−
0
View file @
5d6c26c8
...
...
@@ -650,4 +650,38 @@ ScrollView {
}
Platform.Menu
{
id
:
replyContextMenu
property
string
text
property
string
link
function
show
(
text_
,
link_
)
{
text
=
text_
;
link
=
link_
;
open
();
}
Platform.MenuItem
{
visible
:
replyContextMenu
.
text
enabled
:
visible
text
:
qsTr
(
"
&Copy
"
)
onTriggered
:
Clipboard
.
text
=
replyContextMenu
.
text
}
Platform.MenuItem
{
visible
:
replyContextMenu
.
link
enabled
:
visible
text
:
qsTr
(
"
Copy &link location
"
)
onTriggered
:
Clipboard
.
text
=
replyContextMenu
.
link
}
Platform.MenuItem
{
visible
:
true
enabled
:
visible
text
:
qsTr
(
"
&Go to reply
"
)
onTriggered
:
chat
.
model
.
showEvent
(
eventId
)
}
}
}
This diff is collapsed.
Click to expand it.
resources/qml/delegates/Reply.qml
+
21
−
7
View file @
5d6c26c8
...
...
@@ -7,6 +7,7 @@ import QtQuick.Controls 2.3
import
QtQuick
.
Layouts
1.2
import
QtQuick
.
Window
2.13
import
im
.
nheko
1.0
import
Qt
.
labs
.
platform
1.1
as
Platform
Item
{
id
:
r
...
...
@@ -36,11 +37,6 @@ Item {
width
:
parent
.
width
height
:
replyContainer
.
height
TapHandler
{
onSingleTapped
:
chat
.
model
.
showEvent
(
eventId
)
gesturePolicy
:
TapHandler
.
ReleaseWithinBounds
}
CursorShape
{
anchors.fill
:
parent
cursorShape
:
Qt
.
PointingHandCursor
...
...
@@ -62,6 +58,25 @@ Item {
anchors.leftMargin
:
4
width
:
parent
.
width
-
8
TapHandler
{
acceptedButtons
:
Qt
.
LeftButton
onSingleTapped
:
chat
.
model
.
showEvent
(
r
.
eventId
)
gesturePolicy
:
TapHandler
.
ReleaseWithinBounds
}
TapHandler
{
acceptedButtons
:
Qt
.
RightButton
onLongPressed
:
replyContextMenu
.
show
(
reply
.
child
.
copyText
,
reply
.
child
.
linkAt
(
eventPoint
.
position
.
x
,
eventPoint
.
position
.
y
-
userName_
.
implicitHeight
)
)
onSingleTapped
:
replyContextMenu
.
show
(
reply
.
child
.
copyText
,
reply
.
child
.
linkAt
(
eventPoint
.
position
.
x
,
eventPoint
.
position
.
y
-
userName_
.
implicitHeight
)
)
gesturePolicy
:
TapHandler
.
ReleaseWithinBounds
}
Text
{
id
:
userName_
...
...
@@ -73,7 +88,6 @@ Item {
onSingleTapped
:
chat
.
model
.
openUserProfile
(
userId
)
gesturePolicy
:
TapHandler
.
ReleaseWithinBounds
}
}
MessageDelegate
{
...
...
@@ -99,11 +113,11 @@ Item {
callType
:
r
.
callType
relatedEventCacheBuster
:
r
.
relatedEventCacheBuster
encryptionError
:
r
.
encryptionError
// This is disabled so that left clicking the reply goes to its location
enabled
:
false
width
:
parent
.
width
isReply
:
true
}
}
Rectangle
{
...
...
This diff is collapsed.
Click to expand it.
resources/qml/delegates/TextMessage.qml
+
7
−
0
View file @
5d6c26c8
...
...
@@ -3,6 +3,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
import
"
..
"
import
QtQuick
.
Controls
2.3
import
im
.
nheko
1.0
MatrixText
{
...
...
@@ -35,4 +36,10 @@ MatrixText {
clip
:
isReply
selectByMouse
:
!
Settings
.
mobileMode
&&
!
isReply
font.pointSize
:
(
Settings
.
enlargeEmojiOnlyMessages
&&
isOnlyEmoji
>
0
&&
isOnlyEmoji
<
4
)
?
Settings
.
fontSize
*
3
:
Settings
.
fontSize
CursorShape
{
enabled
:
isReply
anchors.fill
:
parent
cursorShape
:
Qt
.
PointingHandCursor
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment