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,41 +2,50 @@ import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
Rectangle { Column {
readonly property string displayName: readonly property string displayName:
Backend.getUser(section).display_name Backend.getUser(section).display_name
color: "#111"
width: roomListView.width width: roomListView.width
height: childrenRect.height height: paddingItem.height + row.height
RowLayout { Item { id: paddingItem; width: 1; height: row.height / 2 }
Row {
id: row id: row
spacing: 1
width: parent.width width: parent.width
height: avatar.height
Avatar { id: avatar; username: displayName } Avatar { id: avatar; username: displayName }
ColumnLayout { Rectangle {
spacing: 1 color: "#111"
width: parent.width - avatar.width
height: parent.height
PlainLabel { ColumnLayout {
id: accountLabel anchors.fill: parent
text: displayName spacing: 1
color: "#CCC"
elide: Text.ElideRight PlainLabel {
maximumLineCount: 1 id: accountLabel
Layout.fillWidth: true text: displayName
} horizontalAlignment: Qt.AlignHCenter
TextField { color: "#CCC"
id: statusEdit elide: Text.ElideRight
placeholderText: qsTr("Set status message") maximumLineCount: 1
background: Rectangle { color: "#333" } Layout.fillWidth: true
color: "#CCC" }
selectByMouse: true TextField {
font.family: "Roboto" id: statusEdit
font.pixelSize: 12 placeholderText: qsTr("Set status message")
Layout.fillWidth: true background: Rectangle { color: "#333" }
color: "#CCC"
selectByMouse: true
font.family: "Roboto"
font.pixelSize: 12
Layout.fillWidth: true
}
} }
} }
} }

View File

@ -4,12 +4,17 @@ import QtQuick.Layouts 1.4
Rectangle { Rectangle {
id: roomPane id: roomPane
Layout.preferredWidth: 150 width: 180
Layout.minimumWidth: 48
Layout.fillHeight: true Layout.fillHeight: true
color: "gray" color: "gray"
clip: true // Avoid artifacts when resizing pane width to minimum
Column { Column {
anchors.fill: parent x: parent.x
y: parent.y - 48 / 2
width: parent.width
height: parent.height + 48 / 2
ListView { ListView {
width: parent.width width: parent.width
height: parent.height - actionBar.height 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.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
RowLayout { Controls1.SplitView {
anchors.fill: parent anchors.fill: parent
spacing: 0
RoomPane {} RoomPane {}