|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Corner radii and outline stroke of a rectangular entity. More...
#include <headers/guillaume/components/borders.hpp>


Public Types | |
| using | BorderRadius = float |
| A corner radius, in dp. | |
Public Member Functions | |
| Borders (void) | |
| Construct square corners with no stroke: every radius 0, a transparent color and a width of 0. | |
| ~Borders (void)=default | |
| Default destructor for the Borders component. | |
| BorderRadius | getTopLeftRadius (void) const |
| Get the radius of the top-left corner. | |
| Borders & | setTopLeftRadius (BorderRadius radius) |
| Set the radius of the top-left corner. | |
| BorderRadius | getTopRightRadius (void) const |
| Get the radius of the top-right corner. | |
| Borders & | setTopRightRadius (BorderRadius radius) |
| Set the radius of the top-right corner. | |
| BorderRadius | getBottomRightRadius (void) const |
| Get the radius of the bottom-right corner. | |
| Borders & | setBottomRightRadius (BorderRadius radius) |
| Set the radius of the bottom-right corner. | |
| BorderRadius | getBottomLeftRadius (void) const |
| Get the radius of the bottom-left corner. | |
| Borders & | setBottomLeftRadius (BorderRadius radius) |
| Set the radius of the bottom-left corner. | |
| Borders & | setBorderRadius (BorderRadius radius) |
| Set the same radius on the four corners. | |
| Borders & | setColor (const utility::graphic::Color32Bit &color) |
| Set the color of the stroke. | |
| utility::graphic::Color32Bit | getColor (void) const |
| Get the color of the stroke. | |
| Borders & | setWidth (float width) |
| Set the width of the stroke painted by systems::RectangleRender. | |
| float | getWidth (void) const |
| Get the width of the stroke. | |
| bool | hasStroke (void) const |
| Check whether a visible stroke must be painted. | |
| bool | operator== (const Borders &other) const |
| Compare the four radii, the stroke color and the stroke width. The changed flag is not compared. | |
| bool | operator!= (const Borders &other) const |
| Opposite of operator==. | |
| bool | operator< (const Borders &other) const |
| Order borders so they can be used as a key in an ordered container. | |
| 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. | |
Corner radii and outline stroke of a rectangular entity.
systems::RectangleRender (Render phase) reads it, with Transform, Bound and Color, to draw the entity: the bound filled with the entity's components::Color, its corners rounded, and, when hasStroke() is true, an outline of the stroke width and color drawn inside the bound. An entity needs this component, even left at its defaults, to be drawn as a rectangle. systems::FocusRingRender reads the radii too, so the focus ring follows the corners.
Written by the application for a plain surface and by the widget systems for their widgets, which usually take the radius from a theme shape token.
Definition at line 66 of file borders.hpp.
| using guillaume::components::Borders::BorderRadius = float |
A corner radius, in dp.
Definition at line 69 of file borders.hpp.
|
explicit |
Construct square corners with no stroke: every radius 0, a transparent color and a width of 0.
Definition at line 29 of file borders.cpp.

| Borders::BorderRadius guillaume::components::Borders::getBottomLeftRadius | ( | void | ) | const |
Get the radius of the bottom-left corner.
Definition at line 84 of file borders.cpp.

| Borders::BorderRadius guillaume::components::Borders::getBottomRightRadius | ( | void | ) | const |
Get the radius of the bottom-right corner.
Definition at line 69 of file borders.cpp.

| utility::graphic::Color32Bit guillaume::components::Borders::getColor | ( | void | ) | const |
Get the color of the stroke.
Definition at line 117 of file borders.cpp.
| Borders::BorderRadius guillaume::components::Borders::getTopLeftRadius | ( | void | ) | const |
Get the radius of the top-left corner.
Definition at line 39 of file borders.cpp.

| Borders::BorderRadius guillaume::components::Borders::getTopRightRadius | ( | void | ) | const |
Get the radius of the top-right corner.
Definition at line 54 of file borders.cpp.

| float guillaume::components::Borders::getWidth | ( | void | ) | const |
Get the width of the stroke.
Definition at line 135 of file borders.cpp.
| bool guillaume::components::Borders::hasStroke | ( | void | ) | const |
Check whether a visible stroke must be painted.
Definition at line 140 of file borders.cpp.
| bool guillaume::components::Borders::operator!= | ( | const Borders & | other | ) | const |
Opposite of operator==.
| other | The borders to compare with. |
Definition at line 168 of file borders.cpp.

| bool guillaume::components::Borders::operator< | ( | const Borders & | other | ) | const |
Order borders so they can be used as a key in an ordered container.
Compares, in this order, the top-left, top-right, bottom-right and bottom-left radii, then the stroke color. The stroke width is not compared: two borders that differ only by their width are unequal for operator== but neither is less than the other.
| other | The borders to compare with. |
other. Definition at line 173 of file borders.cpp.

| bool guillaume::components::Borders::operator== | ( | const Borders & | other | ) | const |
Compare the four radii, the stroke color and the stroke width. The changed flag is not compared.
| other | The borders to compare with. |
Definition at line 145 of file borders.cpp.

| Borders & guillaume::components::Borders::setBorderRadius | ( | BorderRadius | radius | ) |
Set the same radius on the four corners.
Marks the component changed when at least one corner differs. A radius of half the smaller side of the bound, or more, gives a pill or a circle.
| radius | The radius, in dp (0 for square corners). |
Definition at line 99 of file borders.cpp.

| Borders & guillaume::components::Borders::setBottomLeftRadius | ( | BorderRadius | radius | ) |
Set the radius of the bottom-left corner.
Marks the component changed only when the radius differs.
| radius | The radius, in dp (0 for a square corner). |
Definition at line 89 of file borders.cpp.


| Borders & guillaume::components::Borders::setBottomRightRadius | ( | BorderRadius | radius | ) |
Set the radius of the bottom-right corner.
Marks the component changed only when the radius differs.
| radius | The radius, in dp (0 for a square corner). |
Definition at line 74 of file borders.cpp.


| Borders & guillaume::components::Borders::setColor | ( | const utility::graphic::Color32Bit & | color | ) |
Set the color of the stroke.
Marks the component changed only when the color differs. The stroke is visible only when the width is also above 0.
| color | The stroke color (RGBA); an alpha of 0 hides the stroke. |
Definition at line 107 of file borders.cpp.


| Borders & guillaume::components::Borders::setTopLeftRadius | ( | BorderRadius | radius | ) |
Set the radius of the top-left corner.
Marks the component changed only when the radius differs.
| radius | The radius, in dp (0 for a square corner). |
Definition at line 44 of file borders.cpp.


| Borders & guillaume::components::Borders::setTopRightRadius | ( | BorderRadius | radius | ) |
Set the radius of the top-right corner.
Marks the component changed only when the radius differs.
| radius | The radius, in dp (0 for a square corner). |
Definition at line 59 of file borders.cpp.


| Borders & guillaume::components::Borders::setWidth | ( | float | width | ) |
Set the width of the stroke painted by systems::RectangleRender.
The stroke is drawn inside the bound, following the corner radius. A width of 0 (the default) disables the stroke. Marks the component changed only when the width differs.
| width | The stroke width, in dp; must not be negative. |
| std::invalid_argument | If width is negative. |
Definition at line 122 of file borders.cpp.

