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 {
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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment