Auto-expand room pane to show settings/profiles
If the room pane is below the default width (by user resizing or because of narrow window), go to the room settings or a member profile will automatically expand it as needed. The pane goes back to its previous size once the settings/profile is left. If the window is narrow enough that expanding the pane normally would reduce the timeline's width past its minimum, the pane is shown as an overlay instead.
This commit is contained in:
parent
a44d683956
commit
c018c04cab
1
TODO.md
1
TODO.md
|
@ -92,7 +92,6 @@
|
||||||
|
|
||||||
- Linkify URLs in topic text areas
|
- Linkify URLs in topic text areas
|
||||||
|
|
||||||
- Expand the room pane if it's currently too small to show room settings
|
|
||||||
- Use a loader for items not in view for the `HTabContainer`'s `SwipeView`
|
- Use a loader for items not in view for the `HTabContainer`'s `SwipeView`
|
||||||
|
|
||||||
- Make "Cancel" buttons consistent, and able to cancel running Backend
|
- Make "Cancel" buttons consistent, and able to cancel running Backend
|
||||||
|
|
|
@ -14,12 +14,21 @@ HDrawer {
|
||||||
property int buttonWidth:
|
property int buttonWidth:
|
||||||
buttonRepeater.count > 0 ? buttonRepeater.itemAt(0).implicitWidth : 0
|
buttonRepeater.count > 0 ? buttonRepeater.itemAt(0).implicitWidth : 0
|
||||||
|
|
||||||
|
property bool requireDefaultSize: false
|
||||||
|
|
||||||
readonly property alias buttonRepeater: buttonRepeater
|
readonly property alias buttonRepeater: buttonRepeater
|
||||||
readonly property alias swipeView: swipeView
|
readonly property alias swipeView: swipeView
|
||||||
|
|
||||||
|
|
||||||
defaultSize: buttonRepeater.count * buttonWidth
|
defaultSize: buttonRepeater.count * buttonWidth
|
||||||
minimumSize: buttonWidth
|
minimumSize: requireDefaultSize ? defaultSize : buttonWidth
|
||||||
|
|
||||||
|
Behavior on minimumSize {
|
||||||
|
HNumberAnimation {
|
||||||
|
overshoot: requireDefaultSize ? 1 : 4
|
||||||
|
factor: 0.75
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HColumnLayout {
|
HColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
@ -74,7 +74,15 @@ Item {
|
||||||
|
|
||||||
HLoader {
|
HLoader {
|
||||||
id: loader
|
id: loader
|
||||||
anchors.rightMargin: ready ? roomPane.visibleSize : 0
|
anchors.rightMargin:
|
||||||
|
ready &&
|
||||||
|
! (
|
||||||
|
roomPane.requireDefaultSize &&
|
||||||
|
roomPane.minimumSize > roomPane.maximumSize
|
||||||
|
) ?
|
||||||
|
roomPane.visibleSize :
|
||||||
|
0
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible:
|
visible:
|
||||||
ready ? ! roomPane.hidden || anchors.rightMargin < width : true
|
ready ? ! roomPane.hidden || anchors.rightMargin < width : true
|
||||||
|
|
|
@ -10,6 +10,8 @@ HColumnLayout {
|
||||||
readonly property var modelSyncId:
|
readonly property var modelSyncId:
|
||||||
[chat.userId, chat.roomId, "filtered_members"]
|
[chat.userId, chat.roomId, "filtered_members"]
|
||||||
|
|
||||||
|
readonly property alias viewDepth: stackView.depth
|
||||||
|
|
||||||
|
|
||||||
HStackView {
|
HStackView {
|
||||||
id: stackView
|
id: stackView
|
||||||
|
|
|
@ -32,6 +32,9 @@ MultiviewPane {
|
||||||
buttonWidth:
|
buttonWidth:
|
||||||
buttonRepeater.count >= 1 ? buttonRepeater.itemAt(1).implicitWidth : 0
|
buttonRepeater.count >= 1 ? buttonRepeater.itemAt(1).implicitWidth : 0
|
||||||
|
|
||||||
|
requireDefaultSize:
|
||||||
|
swipeView.currentIndex !== 0 || swipeView.currentItem.viewDepth > 1
|
||||||
|
|
||||||
buttonsBackgroundColor: theme.chat.roomPane.topBar.background
|
buttonsBackgroundColor: theme.chat.roomPane.topBar.background
|
||||||
background: Rectangle { color: theme.chat.roomPane.background }
|
background: Rectangle { color: theme.chat.roomPane.background }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user