Fix implicitheight error.

This commit is contained in:
Black Hat 2019-05-06 09:31:57 +08:00
parent ef469ee347
commit f8f10bb55d
2 changed files with 26 additions and 16 deletions

View File

@ -14,6 +14,7 @@ import Spectral.Effect 2.0
ColumnLayout { ColumnLayout {
readonly property bool avatarVisible: !sentByMe && (aboveAuthor !== author || aboveSection !== section || aboveEventType === "state" || aboveEventType === "emote" || aboveEventType === "other") readonly property bool avatarVisible: !sentByMe && (aboveAuthor !== author || aboveSection !== section || aboveEventType === "state" || aboveEventType === "emote" || aboveEventType === "other")
readonly property bool sentByMe: author === currentRoom.localUser readonly property bool sentByMe: author === currentRoom.localUser
property bool replyVisible: replyEventId || ""
signal saveFileAs() signal saveFileAs()
signal openExternally() signal openExternally()
@ -131,34 +132,38 @@ ColumnLayout {
} }
contentItem: ColumnLayout { contentItem: ColumnLayout {
Control { RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
visible: replyEventId || "" visible: replyVisible
padding: 0 Avatar {
Layout.preferredWidth: 28
Layout.preferredHeight: 28
background: RippleEffect { source: replyVisible ? replyAuthor.avatarMediaId : ""
anchors.fill: parent hint: replyVisible ? replyAuthor.displayName : "H"
onPrimaryClicked: goToEvent(replyEventId) RippleEffect {
anchors.fill: parent
onClicked: userDetailDialog.createObject(ApplicationWindow.overlay, {"room": currentRoom, "user": replyAuthor}).open()
}
} }
contentItem: RowLayout { Control {
spacing: 8 Layout.fillWidth: true
Avatar { padding: 4
Layout.preferredWidth: 28
Layout.preferredHeight: 28
Layout.alignment: Qt.AlignTop
source: replyAuthor ? replyAuthor.avatarMediaId : "" background: RippleEffect {
hint: replyAuthor ? replyAuthor.displayName : "H" onClicked: goToEvent(replyEventId)
} }
Label { contentItem: Label {
Layout.fillWidth: true Layout.fillWidth: true
visible: replyVisible
color: "white" color: "white"
text: "<style>a{color: white;} .user-pill{}</style>" + (replyDisplay || "") text: "<style>a{color: white;} .user-pill{}</style>" + (replyDisplay || "")
@ -172,7 +177,7 @@ ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 1 Layout.preferredHeight: 1
visible: replyEventId || "" visible: replyVisible
color: "white" color: "white"
} }

View File

@ -256,6 +256,11 @@ Item {
} }
} }
} }
DelegateChoice {
roleValue: "other"
delegate: Item {}
}
} }
Button { Button {