|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
State of a tonal surface: how high it sits above the background, and whether it casts a shadow. More...
#include <headers/guillaume/components/surface_tone.hpp>


Public Member Functions | |
| SurfaceTone (void)=default | |
| Create the state of a level 1 surface with a shadow. | |
| ~SurfaceTone (void)=default | |
| Default destructor. | |
| theme::ElevationLevel | getElevation (void) const noexcept |
| Get how high the surface sits above the background. | |
| SurfaceTone & | setElevation (theme::ElevationLevel elevation) |
| Set how high the surface sits above the background. | |
| bool | hasShadow (void) const noexcept |
| Tell whether the surface casts a shadow. | |
| SurfaceTone & | setShadow (bool shadow) |
| Turn the shadow of the surface on or off. | |
| Public Member Functions inherited from guillaume::ecs::Component | |
| bool | hasChanged (void) const |
| Tell whether a value of the component changed since the flags were last reset (the end of the previous frame). | |
| void | setHasChanged (bool hasChanged) |
| Raise or lower the changed flag. | |
| Component (void)=default | |
| Create a component that is not marked as changed. | |
| virtual | ~Component (void)=default |
| Virtual destructor, so components can be destroyed through the base class. | |
State of a tonal surface: how high it sits above the background, and whether it casts a shadow.
The entities::Surface widget writes it. systems::SurfaceTone reads it every frame in the Measure phase and overwrites two other components of the entity: Color (the theme's surface color tinted for the level) and Elevation (the shadow, level 0 when the shadow is off). So on an entity with this component, set the level here, not on Color or Elevation.
Definition at line 43 of file surface_tone.hpp.
|
noexcept |
Get how high the surface sits above the background.
Definition at line 26 of file surface_tone.cpp.
|
noexcept |
Tell whether the surface casts a shadow.
Definition at line 40 of file surface_tone.cpp.

| SurfaceTone & guillaume::components::SurfaceTone::setElevation | ( | theme::ElevationLevel | elevation | ) |
Set how high the surface sits above the background.
A higher level gives a stronger tint and, with the shadow on, a larger shadow. Marks the component changed only when the level differs.
| elevation | The new elevation level. |
Definition at line 31 of file surface_tone.cpp.

| SurfaceTone & guillaume::components::SurfaceTone::setShadow | ( | bool | shadow | ) |
Turn the shadow of the surface on or off.
Without a shadow the surface keeps the tint of its level. Marks the component changed only when the flag differs.
| shadow | True to cast a shadow. |
Definition at line 45 of file surface_tone.cpp.
