quickshell-web/modules_old/Quickshell/PersistentProperties.json

27 lines
1.6 KiB
JSON
Raw Normal View History

2024-09-27 23:35:19 +00:00
{
"name": "PersistentProperties",
"module": "Quickshell",
"type": "class",
"super": {
"type": "local",
"module": "Quickshell",
"name": "Reloadable"
},
"description": "Object that holds properties that can persist across a config reload.",
"details": "PersistentProperties holds properties declated in it across a reload, which is\noften useful for things like keeping expandable popups open and styling them.\n\nBelow is an example of using `PersistentProperties` to keep track of the state\nof an expandable panel. When the configuration is reloaded, the `expanderOpen` property\nwill be saved and the expandable panel will stay in the open/closed state.\n\n```qml\nPersistentProperties {\n id: persist\n reloadableId: \"persistedStates\"\n\n property bool expanderOpen: false\n}\n\nButton {\n id: expanderButton\n anchors.centerIn: parent\n text: \"toggle expander\"\n onClicked: persist.expanderOpen = !persist.expanderOpen\n}\n\nRectangle {\n anchors.top: expanderButton.bottom\n anchors.left: expanderButton.left\n anchors.right: expanderButton.right\n height: 100\n\n color: \"lightblue\"\n visible: persist.expanderOpen\n}\n```\n",
"properties": {},
"functions": [],
"signals": {
"loaded": {
"name": "loaded",
"details": "Called every time the reload stage completes.\nWill be called every time, including when nothing was loaded from an old instance.\n",
"params": []
},
"reloaded": {
"name": "reloaded",
"details": "Called every time the properties are reloaded.\nWill not be called if no old instance was loaded.\n",
"params": []
}
},
"variants": {}
}