TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::Style Struct Reference

A complete style, as parsed from CSS or built in code: layout properties plus the visual properties of each state, in CSS px. More...

#include <gui_core/style/gui_style.h>

Classes

struct  States
 A style's states, indexed by ElementState (or by slot number). More...

Static Public Attributes

static constexpr int16_t kAuto = -1

State slots

The state slots: one per combination of the ElementState bits Active, Hover, Focused, Selected and Selection (0 to 31), and Disabled alone (32).

static constexpr int kStateCount = int(ElementState::Disabled) + 1
 one per state slot
States states {}
 one per state slot
TextLayoutStyle textLayoutStyle {}
 shared by all states
BoxEdges margin {}
 CSS px.
BoxEdges padding {}
 CSS px.
BoxEdges borderWidths {}
 CSS px.
BoxCorners borderRadius {}
 CSS px.
float borderDashSize = 0.0f
 dash length in CSS px; 0 = solid
float borderDashOffset = 0.0f
 offset into the dash pattern, CSS px
BoxShadow focusRing {}
 :focus-visible box-shadow, over the state's shadows
StateLayer stateLayer = StateLayer::None
 -tachyon-state-layer: Content makes the hovered and pressed backgrounds from the state's text color over its background, in place of the :hover / :active ones.
LayoutData layoutData {}
 flex, grid and size properties
uint16_t iconTextGap = 0
 space between icon and text, CSS px
uint16_t iconSize = 0
 icon size in CSS px; 0 = its natural size
int16_t iconOffsetY = 0
 vertical nudge of the icon in CSS px; positive = up
ImageIndex textureIndex = ImageIndex::Invalid
 texture of the texture color types
Display display: 3 = Display::Flex
 CSS: display.
Visibility visibility: 2 = Visibility::Visible
 CSS: visibility.
Overflow overflowX: 2 = Overflow::Auto
 CSS: overflow-x.
Overflow overflowY: 2 = Overflow::Auto
 CSS: overflow-y.
IconSide iconSide: 3 = IconSide::Left
 CSS: -tachyon-icon-side.
AlignItems alignSelf: 3 = AlignItems::Auto
 CSS: align-self; Auto = the container's align-items.
BreakBehavior breakBehavior: 2 = BreakBehavior::Auto
 CSS: break-after.
bool clampScroll: 1 = true
 clamp the scroll offset to the content; false = unbounded
MouseCursor cursor = MouseCursor::Default
 CSS: cursor.
constexpr void SetOverflow (Overflow o) noexcept
 CSS overflow shorthand: sets both axes.

Detailed Description

A complete style, as parsed from CSS or built in code: layout properties plus the visual properties of each state, in CSS px.

StyleManager::Register bakes it into a LayoutStyle, VisualBoxStyle and VisualTextStyle at the UI scale.

Member Function Documentation

◆ SetOverflow()

void tachyon::Style::SetOverflow ( Overflow o)
inlineconstexprnoexcept

CSS overflow shorthand: sets both axes.

Member Data Documentation

◆ kAuto

int16_t tachyon::Style::kAuto = -1
staticconstexpr

◆ kStateCount

int tachyon::Style::kStateCount = int(ElementState::Disabled) + 1
staticconstexpr

one per state slot

◆ states

States tachyon::Style::states {}

one per state slot

◆ textLayoutStyle

TextLayoutStyle tachyon::Style::textLayoutStyle {}

shared by all states

◆ margin

BoxEdges tachyon::Style::margin {}

CSS px.

◆ padding

BoxEdges tachyon::Style::padding {}

CSS px.

◆ borderWidths

BoxEdges tachyon::Style::borderWidths {}

CSS px.

◆ borderRadius

BoxCorners tachyon::Style::borderRadius {}

CSS px.

◆ borderDashSize

float tachyon::Style::borderDashSize = 0.0f

dash length in CSS px; 0 = solid

◆ borderDashOffset

float tachyon::Style::borderDashOffset = 0.0f

offset into the dash pattern, CSS px

◆ focusRing

BoxShadow tachyon::Style::focusRing {}

:focus-visible box-shadow, over the state's shadows

◆ stateLayer

StateLayer tachyon::Style::stateLayer = StateLayer::None

-tachyon-state-layer: Content makes the hovered and pressed backgrounds from the state's text color over its background, in place of the :hover / :active ones.

◆ layoutData

LayoutData tachyon::Style::layoutData {}

flex, grid and size properties

◆ iconTextGap

uint16_t tachyon::Style::iconTextGap = 0

space between icon and text, CSS px

◆ iconSize

uint16_t tachyon::Style::iconSize = 0

icon size in CSS px; 0 = its natural size

◆ iconOffsetY

int16_t tachyon::Style::iconOffsetY = 0

vertical nudge of the icon in CSS px; positive = up

◆ textureIndex

ImageIndex tachyon::Style::textureIndex = ImageIndex::Invalid

texture of the texture color types

◆ display

Display tachyon::Style::display

CSS: display.

◆ visibility

Visibility tachyon::Style::visibility

CSS: visibility.

◆ overflowX

Overflow tachyon::Style::overflowX

CSS: overflow-x.

◆ overflowY

Overflow tachyon::Style::overflowY

CSS: overflow-y.

◆ iconSide

IconSide tachyon::Style::iconSide

CSS: -tachyon-icon-side.

◆ alignSelf

AlignItems tachyon::Style::alignSelf

CSS: align-self; Auto = the container's align-items.

◆ breakBehavior

BreakBehavior tachyon::Style::breakBehavior

CSS: break-after.

◆ clampScroll

bool tachyon::Style::clampScroll

clamp the scroll offset to the content; false = unbounded

◆ cursor

MouseCursor tachyon::Style::cursor = MouseCursor::Default

CSS: cursor.


The documentation for this struct was generated from the following file: