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
1744f38e
Verified
Commit
1744f38e
authored
1 year ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Reenable status part of timeline messages
parent
aff58272
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
resources/qml/MessageView.qml
+103
-18
103 additions, 18 deletions
resources/qml/MessageView.qml
resources/qml/TimelineRow.qml
+5
-9
5 additions, 9 deletions
resources/qml/TimelineRow.qml
with
108 additions
and
27 deletions
resources/qml/MessageView.qml
+
103
−
18
View file @
1744f38e
...
@@ -69,21 +69,23 @@ Item {
...
@@ -69,21 +69,23 @@ Item {
required
property
var
day
required
property
var
day
required
property
bool
isSender
required
property
bool
isSender
//required property var previousMessageDay
//required property bool previousMessageIsStateEvent
//required property string previousMessageUserId
required
property
int
index
required
property
int
index
property
var
previousMessageDay
:
(
index
+
1
)
>=
chat
.
count
?
0
:
chat
.
model
.
dataByIndex
(
index
+
1
,
Room
.
Day
)
property
var
previousMessageDay
:
(
index
+
1
)
>=
chat
.
count
?
0
:
chat
.
model
.
dataByIndex
(
index
+
1
,
Room
.
Day
)
property
bool
previousMessageIsStateEvent
:
(
index
+
1
)
>=
chat
.
count
?
true
:
chat
.
model
.
dataByIndex
(
index
+
1
,
Room
.
IsStateEvent
)
property
bool
previousMessageIsStateEvent
:
(
index
+
1
)
>=
chat
.
count
?
true
:
chat
.
model
.
dataByIndex
(
index
+
1
,
Room
.
IsStateEvent
)
property
string
previousMessageUserId
:
(
index
+
1
)
>=
chat
.
count
?
""
:
chat
.
model
.
dataByIndex
(
index
+
1
,
Room
.
UserId
)
property
string
previousMessageUserId
:
(
index
+
1
)
>=
chat
.
count
?
""
:
chat
.
model
.
dataByIndex
(
index
+
1
,
Room
.
UserId
)
required
property
date
timestamp
required
property
date
timestamp
required
property
string
userId
required
property
string
userId
required
property
string
userName
required
property
string
userName
required
property
string
threadId
required
property
string
threadId
required
property
int
userPowerlevel
required
property
int
userPowerlevel
required
property
bool
isEdited
required
property
bool
isEncrypted
required
property
var
reactions
required
property
var
reactions
required
property
int
status
required
property
int
trustlevel
property
int
avatarMargin
:
(
wrapper
.
isStateEvent
||
Settings
.
smallAvatars
?
0
:
(
Nheko
.
avatarSize
+
8
))
+
(
wrapper
.
threadId
?
6
:
0
)
// align bubble with section header
property
int
avatarMargin
:
(
wrapper
.
isStateEvent
||
Settings
.
smallAvatars
?
0
:
(
Nheko
.
avatarSize
+
8
))
// align bubble with section header
data
:
[
data
:
[
Loader
{
Loader
{
...
@@ -107,16 +109,36 @@ Item {
...
@@ -107,16 +109,36 @@ Item {
visible
:
status
==
Loader
.
Ready
visible
:
status
==
Loader
.
Ready
z
:
4
z
:
4
},
},
Grid
Layout
{
Row
Layout
{
id
:
gridContainer
id
:
gridContainer
width
:
wrapper
.
width
width
:
wrapper
.
width
y
:
section
.
visible
&&
section
.
active
?
section
.
y
+
section
.
height
:
0
y
:
section
.
visible
&&
section
.
active
?
section
.
y
+
section
.
height
:
0
Item
{
Layout.preferredWidth
:
wrapper
.
avatarMargin
}
AbstractButton
{
ToolTip.delay
:
Nheko
.
tooltipDelay
ToolTip.text
:
qsTr
(
"
Part of a thread
"
)
ToolTip.visible
:
hovered
Layout.fillHeight
:
true
visible
:
wrapper
.
threadId
Layout.preferredWidth
:
4
onClicked
:
room
.
thread
=
wrapper
.
threadId
Rectangle
{
id
:
threadLine
anchors.fill
:
parent
color
:
TimelineManager
.
userColor
(
wrapper
.
threadId
,
palette
.
base
)
}
}
ColumnLayout
{
ColumnLayout
{
id
:
contentColumn
id
:
contentColumn
Layout.fillWidth
:
true
Layout.fillWidth
:
true
Layout.leftMargin
:
wrapper
.
avatarMargin
// align bubble with section header
AbstractButton
{
AbstractButton
{
id
:
replyRow
id
:
replyRow
...
@@ -177,11 +199,81 @@ Item {
...
@@ -177,11 +199,81 @@ Item {
]
]
}
}
Rectangle
{
RowLayout
{
color
:
'
yellow
'
id
:
metadata
Layout.preferredWidth
:
100
Layout.preferredHeight
:
20
property
int
iconSize
:
Math
.
floor
(
fontMetrics
.
ascent
*
scaling
)
Layout.alignment
:
Qt
.
AlignRight
|
Qt
.
AlignTop
property
double
scaling
:
Settings
.
bubbles
?
0.75
:
1
Layout.alignment
:
Qt
.
AlignTop
|
Qt
.
AlignRight
Layout.preferredWidth
:
implicitWidth
spacing
:
2
visible
:
!
isStateEvent
StatusIndicator
{
Layout.alignment
:
Qt
.
AlignRight
|
Qt
.
AlignVCenter
eventId
:
wrapper
.
eventId
height
:
parent
.
iconSize
status
:
wrapper
.
status
width
:
parent
.
iconSize
}
Image
{
Layout.alignment
:
Qt
.
AlignRight
|
Qt
.
AlignVCenter
ToolTip.delay
:
Nheko
.
tooltipDelay
ToolTip.text
:
qsTr
(
"
Edited
"
)
ToolTip.visible
:
editHovered
.
hovered
height
:
parent
.
iconSize
source
:
"
image://colorimage/:/icons/icons/ui/edit.svg?
"
+
((
wrapper
.
eventId
==
room
.
edit
)
?
palette
.
highlight
:
palette
.
buttonText
)
sourceSize.height
:
parent
.
iconSize
*
Screen
.
devicePixelRatio
sourceSize.width
:
parent
.
iconSize
*
Screen
.
devicePixelRatio
visible
:
wrapper
.
isEdited
||
wrapper
.
eventId
==
room
.
edit
width
:
parent
.
iconSize
HoverHandler
{
id
:
editHovered
}
}
ImageButton
{
Layout.alignment
:
Qt
.
AlignRight
|
Qt
.
AlignVCenter
ToolTip.delay
:
Nheko
.
tooltipDelay
ToolTip.text
:
qsTr
(
"
Part of a thread
"
)
ToolTip.visible
:
hovered
buttonTextColor
:
TimelineManager
.
userColor
(
wrapper
.
threadId
,
palette
.
base
)
height
:
parent
.
iconSize
image
:
"
:/icons/icons/ui/thread.svg
"
visible
:
wrapper
.
threadId
width
:
parent
.
iconSize
onClicked
:
room
.
thread
=
threadId
}
EncryptionIndicator
{
Layout.alignment
:
Qt
.
AlignRight
|
Qt
.
AlignVCenter
encrypted
:
wrapper
.
isEncrypted
height
:
parent
.
iconSize
sourceSize.height
:
parent
.
iconSize
*
Screen
.
devicePixelRatio
sourceSize.width
:
parent
.
iconSize
*
Screen
.
devicePixelRatio
trust
:
wrapper
.
trustlevel
visible
:
room
.
isEncrypted
width
:
parent
.
iconSize
}
Label
{
id
:
ts
Layout.alignment
:
Qt
.
AlignRight
|
Qt
.
AlignTop
Layout.preferredWidth
:
implicitWidth
ToolTip.delay
:
Nheko
.
tooltipDelay
ToolTip.text
:
Qt
.
formatDateTime
(
wrapper
.
timestamp
,
Qt
.
DefaultLocaleLongDate
)
ToolTip.visible
:
ma
.
hovered
color
:
palette
.
inactive
.
text
font.pointSize
:
fontMetrics
.
font
.
pointSize
*
parent
.
scaling
text
:
wrapper
.
timestamp
.
toLocaleTimeString
(
Locale
.
ShortFormat
)
HoverHandler
{
id
:
ma
}
}
}
}
},
},
...
@@ -214,13 +306,6 @@ Item {
...
@@ -214,13 +306,6 @@ Item {
top
:
reactionRow
.
bottom
top
:
reactionRow
.
bottom
topMargin
:
5
topMargin
:
5
}
}
},
Rectangle
{
width
:
Math
.
min
(
contentColumn
.
implicitWidth
,
contentColumn
.
width
)
height
:
contentColumn
.
implicitHeight
color
:
"
blue
"
opacity
:
0.2
}
}
]
]
}
}
...
...
This diff is collapsed.
Click to expand it.
resources/qml/TimelineRow.qml
+
5
−
9
View file @
1744f38e
...
@@ -232,7 +232,7 @@ AbstractButton {
...
@@ -232,7 +232,7 @@ AbstractButton {
userName: r.userName
userName: r.userName
}
}
*/
*/
Row
{
Row
Layout
{
id
:
metadata
id
:
metadata
property
int
iconSize
:
Math
.
floor
(
fontMetrics
.
ascent
*
scaling
)
property
int
iconSize
:
Math
.
floor
(
fontMetrics
.
ascent
*
scaling
)
...
@@ -249,19 +249,17 @@ AbstractButton {
...
@@ -249,19 +249,17 @@ AbstractButton {
visible
:
!
isStateEvent
visible
:
!
isStateEvent
StatusIndicator
{
StatusIndicator
{
Layout.alignment
:
Qt
.
AlignRight
|
Qt
.
AlignTop
Layout.alignment
:
Qt
.
AlignRight
|
Qt
.
AlignVCenter
anchors.verticalCenter
:
ts
.
verticalCenter
eventId
:
r
.
eventId
eventId
:
r
.
eventId
height
:
parent
.
iconSize
height
:
parent
.
iconSize
status
:
r
.
status
status
:
r
.
status
width
:
parent
.
iconSize
width
:
parent
.
iconSize
}
}
Image
{
Image
{
Layout.alignment
:
Qt
.
AlignRight
|
Qt
.
Align
Top
Layout.alignment
:
Qt
.
AlignRight
|
Qt
.
Align
VCenter
ToolTip.delay
:
Nheko
.
tooltipDelay
ToolTip.delay
:
Nheko
.
tooltipDelay
ToolTip.text
:
qsTr
(
"
Edited
"
)
ToolTip.text
:
qsTr
(
"
Edited
"
)
ToolTip.visible
:
editHovered
.
hovered
ToolTip.visible
:
editHovered
.
hovered
anchors.verticalCenter
:
ts
.
verticalCenter
height
:
parent
.
iconSize
height
:
parent
.
iconSize
source
:
"
image://colorimage/:/icons/icons/ui/edit.svg?
"
+
((
eventId
==
room
.
edit
)
?
palette
.
highlight
:
palette
.
buttonText
)
source
:
"
image://colorimage/:/icons/icons/ui/edit.svg?
"
+
((
eventId
==
room
.
edit
)
?
palette
.
highlight
:
palette
.
buttonText
)
sourceSize.height
:
parent
.
iconSize
*
Screen
.
devicePixelRatio
sourceSize.height
:
parent
.
iconSize
*
Screen
.
devicePixelRatio
...
@@ -275,11 +273,10 @@ AbstractButton {
...
@@ -275,11 +273,10 @@ AbstractButton {
}
}
}
}
ImageButton
{
ImageButton
{
Layout.alignment
:
Qt
.
AlignRight
|
Qt
.
Align
Top
Layout.alignment
:
Qt
.
AlignRight
|
Qt
.
Align
VCenter
ToolTip.delay
:
Nheko
.
tooltipDelay
ToolTip.delay
:
Nheko
.
tooltipDelay
ToolTip.text
:
qsTr
(
"
Part of a thread
"
)
ToolTip.text
:
qsTr
(
"
Part of a thread
"
)
ToolTip.visible
:
hovered
ToolTip.visible
:
hovered
anchors.verticalCenter
:
ts
.
verticalCenter
buttonTextColor
:
TimelineManager
.
userColor
(
threadId
,
palette
.
base
)
buttonTextColor
:
TimelineManager
.
userColor
(
threadId
,
palette
.
base
)
height
:
parent
.
iconSize
height
:
parent
.
iconSize
image
:
"
:/icons/icons/ui/thread.svg
"
image
:
"
:/icons/icons/ui/thread.svg
"
...
@@ -289,8 +286,7 @@ AbstractButton {
...
@@ -289,8 +286,7 @@ AbstractButton {
onClicked
:
room
.
thread
=
threadId
onClicked
:
room
.
thread
=
threadId
}
}
EncryptionIndicator
{
EncryptionIndicator
{
Layout.alignment
:
Qt
.
AlignRight
|
Qt
.
AlignTop
Layout.alignment
:
Qt
.
AlignRight
|
Qt
.
AlignVCenter
anchors.verticalCenter
:
ts
.
verticalCenter
encrypted
:
isEncrypted
encrypted
:
isEncrypted
height
:
parent
.
iconSize
height
:
parent
.
iconSize
sourceSize.height
:
parent
.
iconSize
*
Screen
.
devicePixelRatio
sourceSize.height
:
parent
.
iconSize
*
Screen
.
devicePixelRatio
...
...
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