Don't change chat width when showing overlay panes

When auto-expanding a pane and showing it as an overlay because of
narrow window, make the chat keep the width it had before.

This makes the transition less jarring, reduces the amount of text seen
through a transparent pane, and fix making one pane overlay expanding
the other.
This commit is contained in:
miruka 2020-07-14 16:01:51 -04:00
parent e76143c172
commit c00e35a948
3 changed files with 12 additions and 3 deletions

View File

@ -43,6 +43,11 @@ Drawer {
property int calculatedMinimumSize:
requireDefaultSize ? defaultSize : minimumSize
readonly property int calculatedSizeNoRequiredMinimum:
collapse ?
peekSizeWhileCollapsed :
Math.max(minimumSize, Math.min(preferredSize, maximumSize))
readonly property int calculatedSize:
collapse ?
peekSizeWhileCollapsed :

View File

@ -75,14 +75,18 @@ Item {
HLoader {
id: loader
anchors.rightMargin:
ready && roomPane &&
! roomPane ?
0 :
ready &&
! (
roomPane.requireDefaultSize &&
roomPane.minimumSize > roomPane.maximumSize &&
! roomPane.collapse
) ?
roomPane.visibleSize :
0
roomPane.calculatedSizeNoRequiredMinimum
anchors.fill: parent
visible: ! (ready && roomPane && roomPane.visibleSize >= chat.width)

View File

@ -134,7 +134,7 @@ Item {
anchors.leftMargin:
mainPane.requireDefaultSize &&
mainPane.minimumSize > mainPane.maximumSize ?
0 :
mainPane.calculatedSizeNoRequiredMinimum :
mainPane.visibleSize
visible: mainPane.visibleSize < mainUI.width