Allow quick hiding/expanding of RoomSidePane

by clicking the button corresponding to the currently active view
This commit is contained in:
miruka 2019-05-13 12:01:57 -04:00
parent 125a70bea6
commit 645aa73183
3 changed files with 14 additions and 1 deletions

View File

@ -80,6 +80,15 @@ HColumnLayout {
RoomSidePane {
id: roomSidePane
activeView: roomHeader.activeButton
transform: Translate {
x: roomSidePane.activeView ? 0 : parent.width
Behavior on x {
NumberAnimation { duration: 120 }
}
}
collapsed: width < Layout.minimumWidth + 8
property int referenceWidth: roomHeader.buttonsWidth

View File

@ -8,6 +8,7 @@ HRectangle {
property alias buttonsImplicitWidth: viewButtons.implicitWidth
property int buttonsWidth: viewButtons.Layout.preferredWidth
property var activeButton: "members"
property bool collapseButtons: width < 400
@ -71,7 +72,9 @@ HRectangle {
iconName: "room_view_" + modelData
iconDimension: 22
autoExclusive: true
checked: modelData == "members" // TODO
checked: activeButton == modelData
onClicked: activeButton = activeButton == modelData ?
null : modelData
}
}

View File

@ -6,6 +6,7 @@ HRectangle {
id: roomSidePane
property bool collapsed: false
property var activeView: null
HColumnLayout {
anchors.fill: parent