PaddingSpec
PaddingSpec
Section titled “PaddingSpec”#include <Style.hpp>Specifies padding on all four sides of a widget’s content area.
Padding is the space between a widget’s border and its content. All values are in cells (characters) — percentage-based padding is not supported since it would require knowing the widget’s final size in advance.
Example Usage:
style.padding = [PaddingSpec::all](/api/core/paddingspec#all)(1); // 1 cell on all sidesstyle.padding = [PaddingSpec::xy](/api/core/paddingspec#xy)(2, 1); // 2 left/right, 1 top/bottomstyle.padding = {.top = 1, .bottom = 1}; // manual per-sidePublic Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
int | top | Padding on the top edge (in cells) |
int | bottom | Padding on the bottom edge (in cells) |
int | left | Padding on the left edge (in cells) |
int | right | Padding on the right edge (in cells) |
int top = 0Padding on the top edge (in cells)
bottom
Section titled “bottom”int bottom = 0Padding on the bottom edge (in cells)
int left = 0Padding on the left edge (in cells)
int right = 0Padding on the right edge (in cells)
Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
PaddingSpec | all static inline | Creates equal padding on all four sides. |
PaddingSpec | xy static inline | Creates padding with separate horizontal and vertical values. |
PaddingSpec | none static inline | Creates zero padding on all sides. |
static inline
static inline PaddingSpec all(int v)Creates equal padding on all four sides.
Parameters
Section titled “Parameters”vThe number of cells to pad on each side
static inline
static inline PaddingSpec xy(int x, int y)Creates padding with separate horizontal and vertical values.
Parameters
Section titled “Parameters”-
xPadding on the left and right edges (in cells) -
yPadding on the top and bottom edges (in cells)
static inline
static inline PaddingSpec none()Creates zero padding on all sides.