Save/load sidePane manually-set width
This commit is contained in:
parent
c0b51b574c
commit
daa2c36af1
|
@ -101,4 +101,5 @@ class UIState(JSONConfigFile):
|
||||||
return {
|
return {
|
||||||
"page": "Pages/Default.qml",
|
"page": "Pages/Default.qml",
|
||||||
"pageProperties": {},
|
"pageProperties": {},
|
||||||
|
"sidePaneManualWidth": None,
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
@ -27,7 +39,7 @@ HRectangle {
|
||||||
|
|
||||||
|
|
||||||
property int calculatedWidth: Math.min(
|
property int calculatedWidth: Math.min(
|
||||||
manuallyResized ? manualWidth: parentWidth * autoWidthRatio,
|
manuallyResized ? manualWidth : parentWidth * autoWidthRatio,
|
||||||
maximumCalculatedWidth
|
maximumCalculatedWidth
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user