Code cleanup && add minimum room management. #13

This commit is contained in:
Black Hat
2018-08-09 19:58:19 +08:00
parent b5328ec140
commit 587e298988
13 changed files with 145 additions and 200 deletions

View File

@@ -2,6 +2,8 @@ import QtQuick 2.9
import QtQuick.Controls 2.2
Row {
readonly property bool avatarVisible: !sentByMe && aboveAuthor !== author || section !== aboveSection
spacing: 6
ImageStatus {
@@ -10,7 +12,7 @@ Row {
width: height
height: 40
round: false
visible: !sentByMe && aboveAuthor !== author
visible: avatarVisible
source: author.avatarUrl != "" ? "image://mxc/" + author.avatarUrl : null
displayText: author.displayName
@@ -27,6 +29,6 @@ Row {
width: height
height: 40
color: "transparent"
visible: !sentByMe && aboveAuthor === author
visible: !avatarVisible
}
}

View File

@@ -1,6 +0,0 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
ItemDelegate {
id: itemDelegate
}

View File

@@ -4,7 +4,6 @@ import QtGraphicalEffects 1.0
import QtQuick.Controls.Material 2.2
Item {
property bool opaqueBackground: false
property bool round: true
property string source: ""
property string displayText: ""
@@ -13,14 +12,6 @@ Item {
id: item
Rectangle {
width: item.width
height: item.width
radius: round ? item.width / 2 : 0
color: "white"
visible: opaqueBackground
}
Image {
id: avatar
width: item.width

View File

@@ -3,9 +3,6 @@ import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtQuick.Controls.Material 2.2
Item {
Rectangle {
anchors.fill: parent
color: Material.accent
}
Rectangle {
color: Material.accent
}

View File

@@ -24,7 +24,7 @@ Item {
}
}
ButtonDelegate {
ItemDelegate {
id: buttonDelegate
anchors.fill: parent

View File

@@ -6,7 +6,7 @@ import QtQuick.Layouts 1.3
Rectangle {
property bool flat: false
property bool highlighted: false
property string displayText
property string displayText: ""
property alias timeLabelVisible: timeText.visible
property int maximumWidth