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": {},
|
"collapseAccounts": {},
|
||||||
"page": "Pages/Default.qml",
|
"page": "Pages/Default.qml",
|
||||||
"pageProperties": {},
|
"pageProperties": {},
|
||||||
|
"sidePaneFilter": "",
|
||||||
"sidePaneManualWidth": None,
|
"sidePaneManualWidth": None,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user