Save/load sidePane manually-set width
This commit is contained in:
parent
c0b51b574c
commit
daa2c36af1
|
@ -101,4 +101,5 @@ class UIState(JSONConfigFile):
|
|||
return {
|
||||
"page": "Pages/Default.qml",
|
||||
"pageProperties": {},
|
||||
"sidePaneManualWidth": None,
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user