Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Konheko
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
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
Konheko
Commits
7ffa8eb7
Commit
7ffa8eb7
authored
4 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Fancy hidden timestamps
parent
c39b9940
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
qml/pages/ChatPage.qml
+72
-2
72 additions, 2 deletions
qml/pages/ChatPage.qml
with
72 additions
and
2 deletions
qml/pages/ChatPage.qml
+
72
−
2
View file @
7ffa8eb7
...
...
@@ -123,8 +123,12 @@ Page {
delegate
:
ListItem
{
id
:
messageItem
property
bool
showTimestamp
:
false
contentHeight
:
content
.
height
+
2
*
Theme
.
paddingMedium
width
:
chatView
.
width
onClicked
:
showTimestamp
=
!
showTimestamp
menu
:
messageMenu
BubbleBackground
{
id
:
bubble
...
...
@@ -137,8 +141,8 @@ Page {
color
:
Theme
.
rgba
(
Theme
.
primaryColor
,
Theme
.
opacityFaint
)
opacity
:
model
.
IsSender
?
Theme
.
opacityFaint
:
Theme
.
opacityHigh
radius
:
Theme
.
paddingLarge
height
:
content
.
implicitHeight
+
2
*
Theme
.
paddingSmall
width
:
content
.
implicitWidth
+
2
*
Theme
.
paddingSmall
height
:
content
.
implicitHeight
+
2
*
Theme
.
paddingSmall
roundedCorners
:
BubbleBackground
.
NoCorners
|
(
model
.
IsSender
?
BubbleBackground
.
BottomLeft
:
BubbleBackground
.
BottomRight
)
anchors
{
...
...
@@ -149,7 +153,6 @@ Page {
right
:
model
.
IsSender
?
parent
.
right
:
undefined
left
:
!
model
.
IsSender
?
parent
.
left
:
undefined
top
:
parent
.
top
bottom
:
parent
.
bottom
}
Behavior
on
width
{
...
...
@@ -160,6 +163,16 @@ Page {
}
Behavior
on
height
{
NumberAnimation
{
id
:
contentHeightAnimation
duration
:
100
easing.type
:
Easing
.
InOutQuad
}
}
}
ColumnLayout
{
...
...
@@ -174,6 +187,8 @@ Page {
}
Text
{
id
:
username
text
:
room
.
userIdToUserName
(
model
.
UserId
)
color
:
room
.
userColor
(
model
.
UserId
,
"
#00000000
"
)
Layout.alignment
:
model
.
IsSender
?
Qt
.
AlignRight
:
Qt
.
AlignLeft
...
...
@@ -191,6 +206,8 @@ Page {
Text
{
id
:
ts
visible
:
showTimestamp
height
:
showTimestamp
?
implicitHeight
:
0
Layout.alignment
:
model
.
IsSender
?
Qt
.
AlignRight
:
Qt
.
AlignLeft
text
:
model
.
Timestamp
.
toLocaleString
()
color
:
Theme
.
highlightColor
...
...
@@ -198,6 +215,35 @@ Page {
horizontalAlignment
:
Text
.
AlignRight
}
// padding so that content doesn't jump, when ts hides or unhides
Item
{
Layout.fillHeight
:
true
}
}
Behavior
on
showTimestamp
{
SequentialAnimation
{
NumberAnimation
{
target
:
ts
property
:
"
opacity
"
to
:
0
easing.type
:
Easing
.
InQuad
}
// actually change the controlled property between the 2 other animations
PropertyAction
{
}
NumberAnimation
{
target
:
ts
property
:
"
opacity
"
to
:
1
easing.type
:
Easing
.
OutQuad
}
}
}
}
...
...
@@ -249,4 +295,28 @@ Page {
}
Component
{
id
:
messageMenu
ContextMenu
{
MenuItem
{
text
:
qsTr
(
"
React
"
)
}
MenuItem
{
text
:
qsTr
(
"
Reply
"
)
}
MenuItem
{
text
:
qsTr
(
"
Edit
"
)
}
MenuItem
{
text
:
qsTr
(
"
Redact
"
)
}
}
}
}
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