Add section back.

Enable pixelAligned for flickable.
Tweak timeline delegate.
This commit is contained in:
Black Hat
2019-05-11 20:53:33 +08:00
parent 627647207b
commit 49545df607
12 changed files with 205 additions and 88 deletions

View File

@@ -76,7 +76,7 @@ ColumnLayout {
visible: !(sentByMe || avatarVisible)
text: Qt.formatDateTime(time, "hh:mm")
text: Qt.formatTime(time, "hh:mm AP")
color: "#5B7480"
font.pixelSize: 10
@@ -119,6 +119,58 @@ ColumnLayout {
color: MPalette.background
radius: 18
Rectangle {
anchors.top: parent.top
anchors.left: parent.left
width: parent.width / 2
height: parent.height / 2
visible: !sentByMe && (bubbleShape == 3 || bubbleShape == 2)
color: sentByMe ? MPalette.background : eventType === "notice" ? MPalette.primary : MPalette.accent
radius: 2
}
Rectangle {
anchors.top: parent.top
anchors.right: parent.right
width: parent.width / 2
height: parent.height / 2
visible: sentByMe && (bubbleShape == 3 || bubbleShape == 2)
color: sentByMe ? MPalette.background : eventType === "notice" ? MPalette.primary : MPalette.accent
radius: 2
}
Rectangle {
anchors.bottom: parent.bottom
anchors.left: parent.left
width: parent.width / 2
height: parent.height / 2
visible: !sentByMe && (bubbleShape == 1 || bubbleShape == 2)
color: sentByMe ? MPalette.background : eventType === "notice" ? MPalette.primary : MPalette.accent
radius: 2
}
Rectangle {
anchors.bottom: parent.bottom
anchors.right: parent.right
width: parent.width / 2
height: parent.height / 2
visible: sentByMe && (bubbleShape == 1 || bubbleShape == 2)
color: sentByMe ? MPalette.background : eventType === "notice" ? MPalette.primary : MPalette.accent
radius: 2
}
AutoMouseArea {
anchors.fill: parent

View File

@@ -37,7 +37,7 @@ RowLayout {
Avatar {
Layout.preferredWidth: 32
Layout.preferredHeight: 32
Layout.alignment: Qt.AlignTop
Layout.alignment: Qt.AlignBottom
visible: avatarVisible
hint: author.displayName
@@ -61,16 +61,8 @@ RowLayout {
Label {
Layout.preferredWidth: 32
Layout.preferredHeight: 32
Layout.alignment: Qt.AlignTop
visible: !(sentByMe || avatarVisible)
text: Qt.formatDateTime(time, "hh:mm")
color: "#5B7480"
font.pixelSize: 10
horizontalAlignment: Label.AlignHCenter
verticalAlignment: Label.AlignVCenter
}
BusyIndicator {
@@ -114,7 +106,7 @@ RowLayout {
contentItem: RowLayout {
Label {
text: Qt.formatDateTime(time, "hh:mm")
text: Qt.formatTime(time, "hh:mm AP")
color: "white"
font.pixelSize: 12
}

View File

@@ -27,6 +27,8 @@ ColumnLayout {
spacing: 0
RowLayout {
Layout.alignment: sentByMe ? Qt.AlignRight : Qt.AlignLeft
id: messageRow
spacing: 4
@@ -34,7 +36,7 @@ ColumnLayout {
Avatar {
Layout.preferredWidth: 32
Layout.preferredHeight: 32
Layout.alignment: Qt.AlignTop
Layout.alignment: Qt.AlignBottom
visible: avatarVisible
hint: author.displayName
@@ -189,6 +191,8 @@ ColumnLayout {
Control {
Layout.fillWidth: true
visible: replyVisible
padding: 0
background: RippleEffect {
@@ -196,9 +200,6 @@ ColumnLayout {
}
contentItem: Label {
Layout.fillWidth: true
visible: replyVisible
color: darkBackground ? "white" : MPalette.lighter
text: "<style>a{color: " + (darkBackground ? "white" : MPalette.foreground) + ";} .user-pill{}</style>" + (replyDisplay || "")
@@ -264,16 +265,16 @@ ColumnLayout {
visible: showAuthor
Label {
text: Qt.formatDateTime(time, "hh:mm")
color: MPalette.lighter
}
Label {
visible: !sentByMe
text: author.displayName
color: MPalette.lighter
}
Label {
text: Qt.formatTime(time, "hh:mm AP")
color: MPalette.lighter
}
}
}

View File

@@ -3,10 +3,11 @@ import QtQuick.Controls 2.12
import Spectral.Setting 0.1
Label {
text: section + " • " + Qt.formatTime(time, "hh:mm")
text: section + " • " + Qt.formatTime(time, "hh:mm AP")
color: MPalette.foreground
font.pixelSize: 13
font.weight: Font.Medium
font.capitalization: Font.AllUppercase
verticalAlignment: Text.AlignVCenter
padding: 8
}

View File

@@ -3,26 +3,33 @@ import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import QtQuick.Controls.Material 2.12
import Spectral.Component 2.0
import Spectral.Setting 0.1
Label {
text: "<b>" + author.displayName + "</b> " + display
color: MPalette.foreground
font.pixelSize: 13
font.weight: Font.Medium
Control {
padding: 8
topPadding: 8
bottomPadding: 8
leftPadding: 24
rightPadding: 24
contentItem: RowLayout {
Avatar {
Layout.preferredWidth: 24
Layout.preferredHeight: 24
wrapMode: Label.Wrap
textFormat: MSettings.richText ? Text.RichText : Text.StyledText
onLinkActivated: Qt.openUrlExternally(link)
hint: author.displayName
source: author.avatarMediaId
}
background: Rectangle {
color: MPalette.background
radius: 4
antialiasing: true
Label {
Layout.fillWidth: true
Layout.maximumWidth: messageListView.width - 48
text: "<b>" + author.displayName + "</b> " + display + " • " + Qt.formatTime(time, "hh:mm AP")
color: MPalette.foreground
font.pixelSize: 13
font.weight: Font.Medium
textFormat: Label.StyledText
wrapMode: Label.Wrap
onLinkActivated: Qt.openUrlExternally(link)
}
}
}