Some more UI fine tuning in timeline and room list.

This is a work-in-progress.
This commit is contained in:
Black Hat
2019-05-08 21:15:09 +08:00
parent 1f6eb335d2
commit 927a0aa017
10 changed files with 203 additions and 311 deletions

View File

@@ -9,17 +9,12 @@ import Spectral.Component 2.0
import Spectral.Setting 0.1
Control {
property alias avatar: headerImage.source
property alias topic: headerTopicLabel.text
property bool atTop: false
signal clicked()
id: header
background: Rectangle {
color: Material.background
opacity: atTop ? 0 : 1
color: MPalette.background
layer.enabled: true
layer.effect: ElevationEffect {
@@ -29,53 +24,32 @@ Control {
RowLayout {
anchors.fill: parent
anchors.margins: 12
anchors.leftMargin: 18
Layout.alignment: Qt.AlignVCenter
spacing: 12
Avatar {
Label {
Layout.fillWidth: true
text: currentRoom ? currentRoom.displayName : ""
color: MPalette.foreground
font.pixelSize: 18
elide: Text.ElideRight
wrapMode: Text.NoWrap
}
ToolButton {
Layout.preferredWidth: height
Layout.fillHeight: true
id: headerImage
source: currentRoom.avatarMediaId
hint: currentRoom ? currentRoom.displayName : "No name"
}
ColumnLayout {
Layout.fillWidth: true
Layout.fillHeight: true
visible: parent.width > 64
Label {
Layout.fillWidth: true
Layout.fillHeight: true
text: currentRoom ? currentRoom.displayName : ""
color: MPalette.foreground
font.pixelSize: 16
elide: Text.ElideRight
wrapMode: Text.NoWrap
}
Label {
Layout.fillWidth: true
Layout.fillHeight: true
id: headerTopicLabel
contentItem: MaterialIcon {
icon: "\ue5d4"
color: MPalette.lighter
elide: Text.ElideRight
wrapMode: Text.NoWrap
}
onClicked: header.clicked()
}
}
RippleEffect {
anchors.fill: parent
onClicked: header.clicked()
}
}