Small UI tweaks && bug fixes.

This commit is contained in:
Black Hat
2018-07-20 12:14:02 +08:00
parent 80fca26092
commit 6f6a7da414
11 changed files with 65 additions and 47 deletions

View File

@@ -8,7 +8,7 @@ Item {
readonly property bool downloaded: progressInfo && progressInfo.completed
Rectangle {
z: 5
z: -2
height: parent.height
width: progressInfo.active && !progressInfo.completed ? progressInfo.progress / progressInfo.total * parent.width : 0
color: Material.accent
@@ -25,9 +25,7 @@ Item {
}
onDownloadedChanged: {
if (downloaded && openOnFinished) openSavedFile()
}
onDownloadedChanged: downloaded && openOnFinished ? openSavedFile() : {}
function saveFileAs() {
locationDialog.open()

View File

@@ -9,7 +9,7 @@ AvatarContainer {
width: messageImage.implicitWidth + 24
height: messageImage.implicitHeight + 24
color: sentByMe ? "lightgrey" : Material.accent
color: sentByMe ? background : Material.accent
DownloadableContent {
id: downloadable
@@ -20,6 +20,7 @@ AvatarContainer {
Image {
id: messageImage
z: -4
source: "image://mxc/" + (content.thumbnail_url ? content.thumbnail_url : content.url)
MouseArea {

View File

@@ -13,18 +13,18 @@ AvatarContainer {
width: Math.min(messageText.implicitWidth + 24, messageListView.width - (!sentByMe ? 40 + messageRow.spacing : 0))
height: messageText.implicitHeight + 24
color: isNotice ? "transparent" : sentByMe ? "lightgrey" : Material.accent
color: isNotice ? "transparent" : !sentByMe ? Material.accent : background
border.color: Material.accent
border.width: isNotice ? 2 : 0
Label {
id: messageText
text: display
color: isNotice ? "black" : sentByMe ? "black" : "white"
color: isNotice || sentByMe ? Material.foreground : "white"
anchors.fill: parent
anchors.margins: 12
wrapMode: Label.Wrap
linkColor: isNotice ? Material.accent : sentByMe ? Material.accent : "white"
linkColor: isNotice || sentByMe ? Material.accent : "white"
// textFormat: contentType === "text/html" ? Text.RichText : Text.StyledText
textFormat: Text.StyledText
}

View File

@@ -6,7 +6,10 @@ Item {
id: messageDelegate
readonly property bool sentByMe: author === currentRoom.localUser
readonly property bool darkTheme: Material.theme == Material.Dark
readonly property color background: darkTheme ? "#242424" : "lightgrey"
z: -5
width: delegateLoader.width
height: delegateLoader.height

View File

@@ -10,13 +10,13 @@ Rectangle {
width: Math.min(stateText.implicitWidth + 24, messageListView.width)
height: stateText.implicitHeight + 24
color: isEmote ? Material.accent : "lightgrey"
color: isEmote ? Material.accent : background
Label {
id: stateText
text: "<b>" + author.displayName + "</b> " + display
color: isEmote ? "white" : "black"
linkColor: isEmote ? "white" : Material.accent
color: isEmote ? "white" : Material.foreground
linkColor: isEmote || darkTheme ? "white" : Material.accent
anchors.fill: parent
anchors.margins: 12
wrapMode: Label.Wrap