Make room pane resizable, spacing between accounts

This commit is contained in:
miruka 2019-03-22 20:45:22 -04:00
parent 65a9e420bf
commit 12f14a6a7d
3 changed files with 42 additions and 28 deletions

View File

@ -2,27 +2,35 @@ import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.4
Rectangle {
Column {
readonly property string displayName:
Backend.getUser(section).display_name
color: "#111"
width: roomListView.width
height: childrenRect.height
height: paddingItem.height + row.height
RowLayout {
Item { id: paddingItem; width: 1; height: row.height / 2 }
Row {
id: row
spacing: 1
width: parent.width
height: avatar.height
Avatar { id: avatar; username: displayName }
Rectangle {
color: "#111"
width: parent.width - avatar.width
height: parent.height
ColumnLayout {
anchors.fill: parent
spacing: 1
PlainLabel {
id: accountLabel
text: displayName
horizontalAlignment: Qt.AlignHCenter
color: "#CCC"
elide: Text.ElideRight
maximumLineCount: 1
@ -41,3 +49,4 @@ Rectangle {
}
}
}
}

View File

@ -4,12 +4,17 @@ import QtQuick.Layouts 1.4
Rectangle {
id: roomPane
Layout.preferredWidth: 150
width: 180
Layout.minimumWidth: 48
Layout.fillHeight: true
color: "gray"
clip: true // Avoid artifacts when resizing pane width to minimum
Column {
anchors.fill: parent
x: parent.x
y: parent.y - 48 / 2
width: parent.width
height: parent.height + 48 / 2
ListView {
width: parent.width
height: parent.height - actionBar.height

View File

@ -1,9 +1,9 @@
import QtQuick.Controls 1.4 as Controls1
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4
RowLayout {
Controls1.SplitView {
anchors.fill: parent
spacing: 0
RoomPane {}