Make RoomSidePane follow buttons size again

Also add selected button color
This commit is contained in:
miruka
2019-05-13 10:52:26 -04:00
parent ca6c55a3e7
commit 125a70bea6
4 changed files with 15 additions and 23 deletions

View File

@@ -82,28 +82,13 @@ HColumnLayout {
collapsed: width < Layout.minimumWidth + 8
property int parentWidth: parent.width
property int collapseBelow: 120
property int referenceWidth: roomHeader.buttonsWidth
onReferenceWidthChanged:
if (chatSplitView.canAutoSize) { width = referenceWidth }
function set_width() {
width = parent.width * 0.3 < collapseBelow ?
Layout.minimumWidth :
Math.min(parent.width * 0.3,
roomHeader.buttonsImplicitWidth)
}
onParentWidthChanged:
if (chatSplitView.canAutoSize) { set_width() }
width: set_width() // Initial width
width: referenceWidth // Initial width
Layout.minimumWidth: HStyle.avatar.size
Layout.maximumWidth: parent.width
Behavior on width {
NumberAnimation {
duration: chatSplitView.canAutoSize ? 120 : 0
}
}
}
}
}

View File

@@ -7,6 +7,7 @@ HRectangle {
property string topic: ""
property alias buttonsImplicitWidth: viewButtons.implicitWidth
property int buttonsWidth: viewButtons.Layout.preferredWidth
property bool collapseButtons: width < 400
@@ -69,6 +70,8 @@ HRectangle {
HButton {
iconName: "room_view_" + modelData
iconDimension: 22
autoExclusive: true
checked: modelData == "members" // TODO
}
}