mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:57:35 +00:00
Base: Add manpages for new layout system
This is far from explaining all implications of the new layout system, but it covers the basics.
This commit is contained in:
parent
1d6d074536
commit
a78f84645c
5 changed files with 85 additions and 38 deletions
29
Base/usr/share/man/man5/GML-UI-Dimensions.md
Normal file
29
Base/usr/share/man/man5/GML-UI-Dimensions.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
## Name
|
||||
|
||||
UI Dimensions
|
||||
|
||||
# Description
|
||||
|
||||
UI Dimension (or [GUI::UIDimension](file:///usr/src/serenity/Userland/Libraries/LibGUI/UIDimensions.h) in c++) is a special, union — of positive integer and enum — like, type that is used to represent dimensions in a user interface context.
|
||||
|
||||
It can either store positive integers ≥0 or special meaning values from a pre determined set.
|
||||
|
||||
## Basic Syntax
|
||||
|
||||
In GML UI Dimensions that are "regular" values (integer ≥0) are represented by JSON's int type,
|
||||
while "special" values are represented by their name as a JSON string type.
|
||||
|
||||
# Special Values
|
||||
|
||||
Special Values carry size information that would otherwise not be intuitively possible to be transported by an integer (positive or negative) alone.
|
||||
|
||||
Importantly, while any "regular" (i.e. int ≥0) UI Dimension values might (by convention) be assigned to any UI Dimension property, many properties only allow a subset of the "special" values to be assigned to them.
|
||||
|
||||
| Name | c++ name | GML/JSON representation | General meaning |
|
||||
|-------------------|--------------------------------------------|-------------------------|-------------------------------------------------|
|
||||
| Regular | `GUI::SpecialDimension::Regular` (mock) | int ≥0 | This is a regular integer value specifying a specific size |
|
||||
| Grow | `GUI::SpecialDimension::Grow` | `"grow"` | Grow to the maximum size the surrounding allows |
|
||||
| OpportunisticGrow | `GUI::SpecialDimension::OpportunisticGrow` | `"opportunistic_grow"` | Grow when the opportunity arises, meaning — only when all other widgets have already grown to their maximum size, and only opportunistically growing widgets are left |
|
||||
| Fit | `GUI::SpecialDimension::Fit` | `"fit"` | Grow exactly to the size of the surrounding as determined by other factors, but do not call for e.g. expansion of the parent container itself |
|
||||
| Shrink | `GUI::SpecialDimension::Shrink` | `"shrink"` | Shrink to the smallest size possible |
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue