Keep filter bars from different sidePanes in sync
This commit is contained in:
parent
24ea8fa673
commit
710a5c0914
|
@ -132,6 +132,7 @@ class UIState(JSONConfigFile):
|
|||
"collapseAccounts": {},
|
||||
"page": "Pages/Default.qml",
|
||||
"pageProperties": {},
|
||||
"sidePaneFilter": "",
|
||||
"sidePaneManualWidth": None,
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ Python {
|
|||
|
||||
function saveConfig(backend_attribute, data, callback=null) {
|
||||
if (! py.ready) { return } // config not loaded yet
|
||||
print(backend_attribute, JSON.stringify( data, null, 4))
|
||||
callCoro(backend_attribute + ".write", [data], callback)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import QtQuick 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
import "../Base"
|
||||
|
||||
|
@ -25,5 +26,20 @@ HRowLayout {
|
|||
|
||||
Layout.fillWidth: true
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user