Allow quick hiding/expanding of RoomSidePane
by clicking the button corresponding to the currently active view
This commit is contained in:
parent
125a70bea6
commit
645aa73183
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ HRectangle {
|
|||
id: roomSidePane
|
||||
|
||||
property bool collapsed: false
|
||||
property var activeView: null
|
||||
|
||||
HColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
|
Loading…
Reference in New Issue
Block a user