|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Everything needed to set up a surface in one value: where it is, how it looks and how it arranges its children. More...
#include <headers/guillaume/entities/surface.hpp>
Public Member Functions | |
| SurfaceConfig & | setPose (const utility::graphic::PoseF &value) |
| Set where the surface is. | |
| SurfaceConfig & | setColor (const utility::graphic::Color32Bit &value) |
| Set the fill color. | |
| SurfaceConfig & | setBorderRadius (float value) |
| Set the radius of the four corners. | |
| SurfaceConfig & | setAxis (components::Layout::Axis value) |
| Choose between a row and a column. | |
| SurfaceConfig & | setMainAxisAlignment (components::Layout::MainAxisAlignment value) |
| Set where the children go along the axis. | |
| SurfaceConfig & | setCrossAxisAlignment (components::Layout::CrossAxisAlignment value) |
| Set where the children go across the axis. | |
| SurfaceConfig & | setSpacing (float value) |
| Set the gap between two consecutive children. | |
| SurfaceConfig & | setPadding (float value) |
| Set the gap between the edges of the surface and its children. | |
| SurfaceConfig & | setFixedWidth (float value) |
| Give the surface a width that does not depend on its children. | |
| SurfaceConfig & | setFixedHeight (float value) |
| Give the surface a height that does not depend on its children. | |
Static Public Member Functions | |
| static SurfaceConfig | panel (float width, components::Layout::Axis axis, float spacing) |
| Get the configuration shared by dialog and picker panels. | |
Public Attributes | |
| utility::graphic::PoseF | pose {} |
| Position and orientation of the surface. | |
| utility::graphic::Color32Bit | color |
| Fill color (transparent by default). | |
| float | borderRadius { 0.0f } |
| Radius of the four corners, in dp. | |
| components::Layout::Axis | axis |
| Direction the children are arranged in. | |
| components::Layout::MainAxisAlignment | mainAxisAlignment |
| Where the children go along the axis. | |
| components::Layout::CrossAxisAlignment | crossAxisAlignment |
| Where the children go across the axis. | |
| float | spacing { 0.0f } |
| Gap between two children, in dp. | |
| float | padding |
| Gap between the edges and the children, in dp. | |
| bool | hasFixedWidth |
| True when fixedWidth replaces the content width. | |
| float | fixedWidth |
| Width in dp, used only when hasFixedWidth. | |
| bool | hasFixedHeight |
| True when fixedHeight replaces the content height. | |
| float | fixedHeight |
| Height in dp, used only when hasFixedHeight. | |
Everything needed to set up a surface in one value: where it is, how it looks and how it arranges its children.
A surface is a rectangle that contains other widgets. This struct is a plain value used to pass its settings around: SurfaceBase copies each field into the matching component (Transform, Color, Borders, Layout) and keeps no copy. Every widget constructor that derives from SurfaceBase takes one.
The setters return the configuration, so a value can be written in one expression:
Without a fixed width or height, the surface takes the size of its children plus the padding on both sides.
Definition at line 71 of file surface.hpp.
|
static |
Get the configuration shared by dialog and picker panels.
The result has a fixed width, 24 dp of padding, the extra-large corner radius of the active theme (28 dp by default) and children centered on both axes. The color is left transparent and the height follows the content: the caller sets what differs.
| width | The panel width, in dp. |
| axis | The direction the children are arranged in. |
| spacing | The gap between two children, in dp. |
Definition at line 94 of file surface.cpp.

| SurfaceConfig & guillaume::entities::SurfaceConfig::setAxis | ( | components::Layout::Axis | value | ) |
Choose between a row and a column.
| value | Horizontal to arrange the children left to right, Vertical to arrange them top to bottom. |
Definition at line 48 of file surface.cpp.
| SurfaceConfig & guillaume::entities::SurfaceConfig::setBorderRadius | ( | float | value | ) |
Set the radius of the four corners.
| value | The radius, in dp. 0 gives square corners. |
Definition at line 42 of file surface.cpp.
| SurfaceConfig & guillaume::entities::SurfaceConfig::setColor | ( | const utility::graphic::Color32Bit & | value | ) |
Set the fill color.
| value | The color painted behind the children. |
Definition at line 36 of file surface.cpp.
| SurfaceConfig & guillaume::entities::SurfaceConfig::setCrossAxisAlignment | ( | components::Layout::CrossAxisAlignment | value | ) |
Set where the children go across the axis.
| value | Start, Center or End. |
Definition at line 61 of file surface.cpp.
| SurfaceConfig & guillaume::entities::SurfaceConfig::setFixedHeight | ( | float | value | ) |
Give the surface a height that does not depend on its children.
Sets both fixedHeight and hasFixedHeight.
| value | The height, in dp. |
Definition at line 87 of file surface.cpp.
| SurfaceConfig & guillaume::entities::SurfaceConfig::setFixedWidth | ( | float | value | ) |
Give the surface a width that does not depend on its children.
Sets both fixedWidth and hasFixedWidth.
| value | The width, in dp. |
Definition at line 80 of file surface.cpp.
| SurfaceConfig & guillaume::entities::SurfaceConfig::setMainAxisAlignment | ( | components::Layout::MainAxisAlignment | value | ) |
Set where the children go along the axis.
| value | Start, Center, End or SpaceBetween. |
Definition at line 54 of file surface.cpp.
| SurfaceConfig & guillaume::entities::SurfaceConfig::setPadding | ( | float | value | ) |
Set the gap between the edges of the surface and its children.
| value | The gap, in dp, applied on the four sides. |
Definition at line 74 of file surface.cpp.
| SurfaceConfig & guillaume::entities::SurfaceConfig::setPose | ( | const utility::graphic::PoseF & | value | ) |
Set where the surface is.
| value | The position and orientation of the surface. |
Definition at line 29 of file surface.cpp.
| SurfaceConfig & guillaume::entities::SurfaceConfig::setSpacing | ( | float | value | ) |
Set the gap between two consecutive children.
| value | The gap, in dp. |
Definition at line 68 of file surface.cpp.
| components::Layout::Axis guillaume::entities::SurfaceConfig::axis |
Direction the children are arranged in.
Definition at line 78 of file surface.hpp.
| float guillaume::entities::SurfaceConfig::borderRadius { 0.0f } |
Radius of the four corners, in dp.
Definition at line 77 of file surface.hpp.
| utility::graphic::Color32Bit guillaume::entities::SurfaceConfig::color |
Fill color (transparent by default).
Definition at line 74 of file surface.hpp.
| components::Layout::CrossAxisAlignment guillaume::entities::SurfaceConfig::crossAxisAlignment |
Where the children go across the axis.
Definition at line 84 of file surface.hpp.
| float guillaume::entities::SurfaceConfig::fixedHeight |
Height in dp, used only when hasFixedHeight.
Definition at line 100 of file surface.hpp.
| float guillaume::entities::SurfaceConfig::fixedWidth |
Width in dp, used only when hasFixedWidth.
Definition at line 94 of file surface.hpp.
| bool guillaume::entities::SurfaceConfig::hasFixedHeight |
True when fixedHeight replaces the content height.
Definition at line 97 of file surface.hpp.
| bool guillaume::entities::SurfaceConfig::hasFixedWidth |
True when fixedWidth replaces the content width.
Definition at line 91 of file surface.hpp.
| components::Layout::MainAxisAlignment guillaume::entities::SurfaceConfig::mainAxisAlignment |
Where the children go along the axis.
Definition at line 81 of file surface.hpp.
| float guillaume::entities::SurfaceConfig::padding |
Gap between the edges and the children, in dp.
Definition at line 88 of file surface.hpp.
| utility::graphic::PoseF guillaume::entities::SurfaceConfig::pose {} |
Position and orientation of the surface.
Definition at line 73 of file surface.hpp.
| float guillaume::entities::SurfaceConfig::spacing { 0.0f } |
Gap between two children, in dp.
Definition at line 87 of file surface.hpp.