diff --git a/src/python/config_files.py b/src/python/config_files.py index 7dc92478..3eab57bc 100644 --- a/src/python/config_files.py +++ b/src/python/config_files.py @@ -99,6 +99,7 @@ class UIState(JSONConfigFile): async def default_data(self) -> JsonData: return { - "page": "Pages/Default.qml", - "pageProperties": {}, + "page": "Pages/Default.qml", + "pageProperties": {}, + "sidePaneManualWidth": None, } diff --git a/src/qml/SidePane/SidePane.qml b/src/qml/SidePane/SidePane.qml index 5cb6fa54..6a4d2b8e 100644 --- a/src/qml/SidePane/SidePane.qml +++ b/src/qml/SidePane/SidePane.qml @@ -16,6 +16,18 @@ HRectangle { property bool manuallyResized: false 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( manuallyResized ? manualWidth : theme.sidePane.maximumAutoWidth, window.width - theme.minimumSupportedWidthPlusSpacing @@ -27,7 +39,7 @@ HRectangle { property int calculatedWidth: Math.min( - manuallyResized ? manualWidth: parentWidth * autoWidthRatio, + manuallyResized ? manualWidth : parentWidth * autoWidthRatio, maximumCalculatedWidth )