1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-12 10:45:38 +02:00

mainview: make sidepanel fully resizable

GitLab: #306
Change-Id: I13b58a5069968782e30005fe9418f99ac3c15c97
This commit is contained in:
Sébastien Blin 2021-12-17 14:04:40 -05:00
parent 4f56561fdd
commit 7139eecce3

View file

@ -38,7 +38,7 @@ Rectangle {
objectName: "mainView"
property int sidePanelViewStackMinimumWidth: 300
property int sidePanelViewStackCurrentWidth: 300
property int mainViewStackPreferredWidth: 425
property int settingsViewPreferredWidth: 460
property int onWidthChangedTriggerDistance: 5
@ -154,7 +154,7 @@ Rectangle {
sidePanelViewStack.push(settingsMenu, StackView.Immediate)
var windowCurrentMinimizedSize = settingsViewPreferredWidth
+ sidePanelViewStackMinimumWidth + onWidthChangedTriggerDistance
+ sidePanelViewStackCurrentWidth + onWidthChangedTriggerDistance
if (appWindow.width < windowCurrentMinimizedSize)
appWindow.width = windowCurrentMinimizedSize
}
@ -262,10 +262,8 @@ Rectangle {
Rectangle {
id: mainViewSidePanelRect
SplitView.minimumWidth: sidePanelViewStackMinimumWidth
SplitView.maximumWidth: (sidePanelOnly ?
splitView.width :
splitView.width - sidePanelViewStackMinimumWidth)
SplitView.maximumWidth: splitView.width
SplitView.preferredWidth: sidePanelViewStackCurrentWidth
SplitView.fillHeight: true
color: JamiTheme.backgroundColor
@ -308,11 +306,8 @@ Rectangle {
initialItem: welcomePage
SplitView.maximumWidth: sidePanelOnly ?
splitView.width :
splitView.width - sidePanelViewStackMinimumWidth
SplitView.maximumWidth: splitView.width
SplitView.preferredWidth: mainViewStackPreferredWidth
SplitView.minimumWidth: sidePanelViewStackMinimumWidth
SplitView.fillHeight: true
clip: true
@ -402,9 +397,8 @@ Rectangle {
onWidthChanged: {
// Hide unnecessary stackview when width is changed.
var widthToCompare = previousWidth < mainView.width ?
sidePanelViewStackMinimumWidth :
(sidePanelViewStackMinimumWidth +
(inSettingsView ? settingsViewPreferredWidth : mainViewStackPreferredWidth))
0 :
(inSettingsView ? settingsViewPreferredWidth : mainViewStackPreferredWidth)
if (mainView.width < widthToCompare - onWidthChangedTriggerDistance
&& mainViewStack.visible) {