Save/load sidePane manually-set width

This commit is contained in:
miruka 2019-07-21 09:08:22 -04:00
parent c0b51b574c
commit daa2c36af1
2 changed files with 16 additions and 3 deletions

View File

@ -101,4 +101,5 @@ class UIState(JSONConfigFile):
return { return {
"page": "Pages/Default.qml", "page": "Pages/Default.qml",
"pageProperties": {}, "pageProperties": {},
"sidePaneManualWidth": None,
} }

View File

@ -16,6 +16,18 @@ HRectangle {
property bool manuallyResized: false property bool manuallyResized: false
property int manualWidth: 0 property int manualWidth: 0
Component.onCompleted: {
if (window.uiState.sidePaneManualWidth) {
manualWidth = window.uiState.sidePaneManualWidth
manuallyResized = true
}
}
onManualWidthChanged: {
window.uiState.sidePaneManualWidth = manualWidth
window.uiStateChanged()
}
property int maximumCalculatedWidth: Math.min( property int maximumCalculatedWidth: Math.min(
manuallyResized ? manualWidth : theme.sidePane.maximumAutoWidth, manuallyResized ? manualWidth : theme.sidePane.maximumAutoWidth,
window.width - theme.minimumSupportedWidthPlusSpacing window.width - theme.minimumSupportedWidthPlusSpacing