2018-12-07 01:18:42 +00:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.4
|
2018-10-02 02:07:47 +00:00
|
|
|
import QtQuick.Layouts 1.3
|
2018-12-07 01:18:42 +00:00
|
|
|
import QtQuick.Controls.Material 2.4
|
2018-10-02 02:07:47 +00:00
|
|
|
|
|
|
|
import Spectral 0.1
|
2018-11-16 12:30:42 +00:00
|
|
|
import Spectral.Effect 2.0
|
2018-12-03 11:55:42 +00:00
|
|
|
import Spectral.Component 2.0
|
2018-10-02 02:07:47 +00:00
|
|
|
|
2018-11-17 12:52:17 +00:00
|
|
|
Control {
|
2018-12-03 11:55:42 +00:00
|
|
|
property alias avatar: headerImage.source
|
2018-10-02 02:07:47 +00:00
|
|
|
property alias topic: headerTopicLabel.text
|
2018-11-16 12:30:42 +00:00
|
|
|
property bool atTop: false
|
2018-10-02 02:07:47 +00:00
|
|
|
signal clicked()
|
|
|
|
|
|
|
|
id: header
|
|
|
|
|
2018-11-17 12:52:17 +00:00
|
|
|
background: Rectangle {
|
|
|
|
color: Material.background
|
2018-11-16 12:30:42 +00:00
|
|
|
|
2018-11-17 12:52:17 +00:00
|
|
|
opacity: atTop ? 0 : 1
|
|
|
|
|
|
|
|
layer.enabled: true
|
|
|
|
layer.effect: ElevationEffect {
|
|
|
|
elevation: 2
|
|
|
|
}
|
2018-11-16 12:30:42 +00:00
|
|
|
}
|
2018-10-02 02:07:47 +00:00
|
|
|
|
2018-11-17 12:52:17 +00:00
|
|
|
RowLayout {
|
2018-10-02 02:07:47 +00:00
|
|
|
anchors.fill: parent
|
2018-11-17 12:52:17 +00:00
|
|
|
anchors.margins: 12
|
2018-10-02 02:07:47 +00:00
|
|
|
|
2018-11-17 12:52:17 +00:00
|
|
|
spacing: 12
|
2018-10-02 02:07:47 +00:00
|
|
|
|
2018-12-03 11:55:42 +00:00
|
|
|
Avatar {
|
2018-11-17 12:52:17 +00:00
|
|
|
Layout.preferredWidth: height
|
|
|
|
Layout.fillHeight: true
|
2018-10-02 02:07:47 +00:00
|
|
|
|
2018-11-17 12:52:17 +00:00
|
|
|
id: headerImage
|
2018-10-02 02:07:47 +00:00
|
|
|
|
2018-12-03 11:55:42 +00:00
|
|
|
source: currentRoom.avatarUrl
|
2018-11-17 12:52:17 +00:00
|
|
|
hint: currentRoom ? currentRoom.displayName : "No name"
|
|
|
|
}
|
2018-10-02 02:07:47 +00:00
|
|
|
|
2018-11-17 12:52:17 +00:00
|
|
|
ColumnLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2018-10-02 02:07:47 +00:00
|
|
|
|
2018-11-17 12:52:17 +00:00
|
|
|
visible: parent.width > 64
|
2018-10-02 02:07:47 +00:00
|
|
|
|
2018-11-17 12:52:17 +00:00
|
|
|
Label {
|
2018-10-02 02:07:47 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
2018-11-17 12:52:17 +00:00
|
|
|
text: currentRoom ? currentRoom.displayName : ""
|
2018-11-18 23:29:55 +00:00
|
|
|
font.pixelSize: 16
|
2018-11-17 12:52:17 +00:00
|
|
|
elide: Text.ElideRight
|
|
|
|
wrapMode: Text.NoWrap
|
|
|
|
}
|
2018-10-02 02:07:47 +00:00
|
|
|
|
2018-11-17 12:52:17 +00:00
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2018-10-02 02:07:47 +00:00
|
|
|
|
2018-11-17 12:52:17 +00:00
|
|
|
id: headerTopicLabel
|
2018-10-02 02:07:47 +00:00
|
|
|
|
2018-11-17 12:52:17 +00:00
|
|
|
color: "#5B7480"
|
|
|
|
elide: Text.ElideRight
|
|
|
|
wrapMode: Text.NoWrap
|
2018-10-02 02:07:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-17 12:52:17 +00:00
|
|
|
|
|
|
|
RippleEffect {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
onClicked: header.clicked()
|
|
|
|
}
|
2018-10-02 02:07:47 +00:00
|
|
|
}
|