Animate SidePane width only when collapsing
To avoid RoomHeaderButton collapse bug due to the "slowly" changing Chat width.
This commit is contained in:
parent
46d5704eb6
commit
b9b6d2fcb3
@ -78,7 +78,7 @@ HRectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Behavior on Layout.maximumWidth {
|
Behavior on Layout.maximumWidth {
|
||||||
NumberAnimation { id: buttonsAnimation; duration: 150 }
|
NumberAnimation { id: buttonsAnimation; duration: 120 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ Column {
|
|||||||
bottomMargin: topMargin
|
bottomMargin: topMargin
|
||||||
|
|
||||||
Behavior on spacing {
|
Behavior on spacing {
|
||||||
NumberAnimation { duration: 150 }
|
NumberAnimation { duration: 120 }
|
||||||
}
|
}
|
||||||
|
|
||||||
model: chatPage.roomInfo.members
|
model: chatPage.roomInfo.members
|
||||||
|
@ -21,17 +21,10 @@ HRectangle {
|
|||||||
Layout.leftMargin: spacing
|
Layout.leftMargin: spacing
|
||||||
|
|
||||||
Behavior on spacing {
|
Behavior on spacing {
|
||||||
NumberAnimation { duration: 150 }
|
NumberAnimation { duration: 120 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PaneToolBar {}
|
PaneToolBar {}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on width {
|
|
||||||
NumberAnimation {
|
|
||||||
// Don't slow down the user manually resizing
|
|
||||||
duration: uiSplitView.canAutoSize ? 150 : 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -24,20 +24,33 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
SidePane {
|
SidePane {
|
||||||
|
id: sidePane
|
||||||
visible: accountsLoggedIn
|
visible: accountsLoggedIn
|
||||||
collapsed: width < Layout.minimumWidth + normalSpacing
|
collapsed: width < Layout.minimumWidth + normalSpacing
|
||||||
|
|
||||||
|
property int parentWidth: parent.width
|
||||||
|
property int collapseBelow: 120
|
||||||
|
|
||||||
function set_width() {
|
function set_width() {
|
||||||
width = parent.width * 0.3 < 120 ?
|
width = parent.width * 0.3 < collapseBelow ?
|
||||||
Layout.minimumWidth : Math.min(parent.width * 0.3, 300)
|
Layout.minimumWidth : Math.min(parent.width * 0.3, 300)
|
||||||
}
|
}
|
||||||
|
|
||||||
property int parentWidth: parent.width
|
|
||||||
onParentWidthChanged: if (uiSplitView.canAutoSize) { set_width() }
|
onParentWidthChanged: if (uiSplitView.canAutoSize) { set_width() }
|
||||||
|
|
||||||
width: set_width() // Initial width
|
width: set_width() // Initial width
|
||||||
Layout.minimumWidth: HStyle.avatar.size
|
Layout.minimumWidth: HStyle.avatar.size
|
||||||
Layout.maximumWidth: parent.width
|
Layout.maximumWidth: parent.width
|
||||||
|
|
||||||
|
Behavior on width {
|
||||||
|
NumberAnimation {
|
||||||
|
// Don't slow down the user manually resizing
|
||||||
|
duration:
|
||||||
|
(uiSplitView.canAutoSize &&
|
||||||
|
parent.width * 0.3 < sidePane.collapseBelow * 1.2) ?
|
||||||
|
120 : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StackView {
|
StackView {
|
||||||
|
Loading…
Reference in New Issue
Block a user