Keep filter bars from different sidePanes in sync

This commit is contained in:
miruka 2019-08-15 11:29:22 -04:00
parent 24ea8fa673
commit 710a5c0914
3 changed files with 18 additions and 0 deletions

View File

@ -132,6 +132,7 @@ class UIState(JSONConfigFile):
"collapseAccounts": {}, "collapseAccounts": {},
"page": "Pages/Default.qml", "page": "Pages/Default.qml",
"pageProperties": {}, "pageProperties": {},
"sidePaneFilter": "",
"sidePaneManualWidth": None, "sidePaneManualWidth": None,
} }

View File

@ -34,6 +34,7 @@ Python {
function saveConfig(backend_attribute, data, callback=null) { function saveConfig(backend_attribute, data, callback=null) {
if (! py.ready) { return } // config not loaded yet if (! py.ready) { return } // config not loaded yet
print(backend_attribute, JSON.stringify( data, null, 4))
callCoro(backend_attribute + ".write", [data], callback) callCoro(backend_attribute + ".write", [data], callback)
} }

View File

@ -1,3 +1,4 @@
import QtQuick 2.12
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import "../Base" import "../Base"
@ -25,5 +26,20 @@ HRowLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: parent.height Layout.preferredHeight: parent.height
onTextChanged: {
if (window.uiState.sidePaneFilter == text) return
print("save")
window.uiState.sidePaneFilter = text
window.uiStateChanged()
}
Connections {
target: window
// Keep multiple instances of PaneToolBar in sync
onUiStateChanged: filterField.text = uiState.sidePaneFilter
}
} }
} }