Skip to content
Snippets Groups Projects
Commit 7139eecc authored by Sébastien Blin's avatar Sébastien Blin
Browse files

mainview: make sidepanel fully resizable

GitLab: #306
Change-Id: I13b58a5069968782e30005fe9418f99ac3c15c97
parent 4f56561f
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,7 @@ Rectangle { ...@@ -38,7 +38,7 @@ Rectangle {
objectName: "mainView" objectName: "mainView"
property int sidePanelViewStackMinimumWidth: 300 property int sidePanelViewStackCurrentWidth: 300
property int mainViewStackPreferredWidth: 425 property int mainViewStackPreferredWidth: 425
property int settingsViewPreferredWidth: 460 property int settingsViewPreferredWidth: 460
property int onWidthChangedTriggerDistance: 5 property int onWidthChangedTriggerDistance: 5
...@@ -154,7 +154,7 @@ Rectangle { ...@@ -154,7 +154,7 @@ Rectangle {
sidePanelViewStack.push(settingsMenu, StackView.Immediate) sidePanelViewStack.push(settingsMenu, StackView.Immediate)
var windowCurrentMinimizedSize = settingsViewPreferredWidth var windowCurrentMinimizedSize = settingsViewPreferredWidth
+ sidePanelViewStackMinimumWidth + onWidthChangedTriggerDistance + sidePanelViewStackCurrentWidth + onWidthChangedTriggerDistance
if (appWindow.width < windowCurrentMinimizedSize) if (appWindow.width < windowCurrentMinimizedSize)
appWindow.width = windowCurrentMinimizedSize appWindow.width = windowCurrentMinimizedSize
} }
...@@ -262,10 +262,8 @@ Rectangle { ...@@ -262,10 +262,8 @@ Rectangle {
Rectangle { Rectangle {
id: mainViewSidePanelRect id: mainViewSidePanelRect
SplitView.minimumWidth: sidePanelViewStackMinimumWidth SplitView.maximumWidth: splitView.width
SplitView.maximumWidth: (sidePanelOnly ? SplitView.preferredWidth: sidePanelViewStackCurrentWidth
splitView.width :
splitView.width - sidePanelViewStackMinimumWidth)
SplitView.fillHeight: true SplitView.fillHeight: true
color: JamiTheme.backgroundColor color: JamiTheme.backgroundColor
...@@ -308,11 +306,8 @@ Rectangle { ...@@ -308,11 +306,8 @@ Rectangle {
initialItem: welcomePage initialItem: welcomePage
SplitView.maximumWidth: sidePanelOnly ? SplitView.maximumWidth: splitView.width
splitView.width :
splitView.width - sidePanelViewStackMinimumWidth
SplitView.preferredWidth: mainViewStackPreferredWidth SplitView.preferredWidth: mainViewStackPreferredWidth
SplitView.minimumWidth: sidePanelViewStackMinimumWidth
SplitView.fillHeight: true SplitView.fillHeight: true
clip: true clip: true
...@@ -402,9 +397,8 @@ Rectangle { ...@@ -402,9 +397,8 @@ Rectangle {
onWidthChanged: { onWidthChanged: {
// Hide unnecessary stackview when width is changed. // Hide unnecessary stackview when width is changed.
var widthToCompare = previousWidth < mainView.width ? var widthToCompare = previousWidth < mainView.width ?
sidePanelViewStackMinimumWidth : 0 :
(sidePanelViewStackMinimumWidth + (inSettingsView ? settingsViewPreferredWidth : mainViewStackPreferredWidth)
(inSettingsView ? settingsViewPreferredWidth : mainViewStackPreferredWidth))
if (mainView.width < widthToCompare - onWidthChangedTriggerDistance if (mainView.width < widthToCompare - onWidthChangedTriggerDistance
&& mainViewStack.visible) { && mainViewStack.visible) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment