1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:37:35 +00:00

LibGUI: Add DynamicWidgetContainter

Add a new widget "DynamicWidgetContainer" that is used to group it's
child widgets within an collapsable and detachable container. The
DynmnicWidgetContainer is able to persist it's view state if a config
domain has been provided. Having that set will allow the widget to
restore it's view state automatically.
This commit is contained in:
Torstennator 2023-09-15 12:06:01 +02:00 committed by Andrew Kaster
parent 38974b4128
commit b65e711929
10 changed files with 777 additions and 0 deletions

View file

@ -41,6 +41,7 @@ Or right clicking on a folder in the TreeView and using
- [CheckBox](help://man/5/GML/Widget/CheckBox)
- [ColorInput](help://man/5/GML/Widget/ColorInput)
- [ComboBox](help://man/5/GML/Widget/ComboBox)
- [DynamicWidgetContainer](help://man/5/GML/Widget/DynamicWidgetContainer)
- [Frame](help://man/5/GML/Widget/Frame)
- [GroupBox](help://man/5/GML/Widget/GroupBox)
- [HorizontalProgressbar](help://man/5/GML/Widget/HorizontalProgressbar)

View file

@ -0,0 +1,67 @@
## Name
GML DynamicWidgetContainer
## Description
Defines a container widget that will group its child widgets together so that they can be collapsed, expanded or detached to a new window as one unit. If DynamicWidgetContainers are nested within one DynamicWidgetContainer it is possible to move the positions of the child containers dynamically.
| Property | Description |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| config_domain | Defines if the changes to the widget's view state should be persisted. It is required that the domain has been already pleged by the application. |
| detached_size | Defines a size that the detached widget window should initially have. If not defined, the window will have the current size of the widget. |
| section_label | The label that will be used for the section. |
| show_controls | Defines if the buttons and label should be visible or not. This allows e.g. a parent container to hide its controls but provide rearrenage functionality. |
| with_individual_order | Configured on a parent container to enable the persistence of rearranged child containers. |
## Synopsis
`@GUI::DynamicWidgetContainer`
## Examples
Simple container:
```gml
@GUI::DynamicWidgetContainer {
section_label: "Section 1"
@GUI::Widget {
}
@GUI::Widget {
}
}
```
Nested containers with persistence:
```gml
@GUI::DynamicWidgetContainer {
section_label: "Parent Section"
config_domain: "abc"
with_individual_order: true
detached_size: [200, 640]
@GUI::DynamicWidgetContainer {
section_label: "Section 1"
config_domain: "abc"
@GUI::Widget {
}
@GUI::Widget {
}
}
@GUI::DynamicWidgetContainer {
section_label: "Section 2"
config_domain: "abc"
@GUI::Widget {
}
@GUI::Widget {
}
}
}
```