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 {
|
RoomSidePane {
|
||||||
id: 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
|
collapsed: width < Layout.minimumWidth + 8
|
||||||
|
|
||||||
property int referenceWidth: roomHeader.buttonsWidth
|
property int referenceWidth: roomHeader.buttonsWidth
|
||||||
|
@ -8,6 +8,7 @@ HRectangle {
|
|||||||
|
|
||||||
property alias buttonsImplicitWidth: viewButtons.implicitWidth
|
property alias buttonsImplicitWidth: viewButtons.implicitWidth
|
||||||
property int buttonsWidth: viewButtons.Layout.preferredWidth
|
property int buttonsWidth: viewButtons.Layout.preferredWidth
|
||||||
|
property var activeButton: "members"
|
||||||
|
|
||||||
property bool collapseButtons: width < 400
|
property bool collapseButtons: width < 400
|
||||||
|
|
||||||
@ -71,7 +72,9 @@ HRectangle {
|
|||||||
iconName: "room_view_" + modelData
|
iconName: "room_view_" + modelData
|
||||||
iconDimension: 22
|
iconDimension: 22
|
||||||
autoExclusive: true
|
autoExclusive: true
|
||||||
checked: modelData == "members" // TODO
|
checked: activeButton == modelData
|
||||||
|
onClicked: activeButton = activeButton == modelData ?
|
||||||
|
null : modelData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ HRectangle {
|
|||||||
id: roomSidePane
|
id: roomSidePane
|
||||||
|
|
||||||
property bool collapsed: false
|
property bool collapsed: false
|
||||||
|
property var activeView: null
|
||||||
|
|
||||||
HColumnLayout {
|
HColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
Loading…
x
Reference in New Issue
Block a user