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

The layout part of a registered Style, in pixels; shared by every style with the same values. More...

#include <gui_core/style/gui_style.h>

Public Member Functions

uint64_t GetHashCode () const noexcept
 Hash of a subset of the fields, for deduplication; operator== settles collisions.
bool operator== (const LayoutStyle &other) const noexcept=default
constexpr bool IsInFlow () const
 Takes part in layout: not display: none and not collapsed.
constexpr bool IsFlexContainer () const
 display is Flex.
constexpr int16_t GetMinWidth () const
 Horizontal margin + border + padding: the narrowest the element can be.
constexpr int16_t GetMinHeight () const
 Vertical margin + border + padding: the shortest the element can be.
constexpr short2 GetMinSize () const
 GetMinWidth and GetMinHeight together.
IntRect GetPaddingBoxContentRect (const IntRect &borderBox) const
 The content box of a border-box rect: borderBox minus border and padding.
IntRect GetContentRect (const IntRect &outer) const
 The content box of a margin-box rect: outer minus margin, border and padding.
IntRect GetBorderRect (const IntRect &outer) const
 The border box of a margin-box rect: outer minus margin.
IntRect GetPaddingRect (const IntRect &outer) const
 The padding box of a margin-box rect: outer minus margin and border.
int32_t GetBorderBoxWidth () const noexcept
 Horizontal padding plus border widths, in pixels.

Public Attributes

BoxEdges margin {}
 pixels
BoxEdges padding {}
 pixels
BoxEdges borderWidths {}
 pixels
LayoutData layoutData {}
 flex, grid and size properties, in pixels
TextLayoutStyle textLayoutStyle {}
 see Style::textLayoutStyle
uint16_t iconTextGap = 0
 space between icon and text, pixels
uint16_t iconSize = 0
 icon size in pixels; 0 = its natural size
int16_t iconOffsetY = 0
 vertical nudge of an icon-only element in pixels; positive = up
Display display: 3 = Display::Flex
 see Style::display
Visibility visibility: 2 = Visibility::Visible
 see Style::visibility
Overflow overflowX: 2 = Overflow::Visible
 see Style::overflowX
Overflow overflowY: 2 = Overflow::Visible
 see Style::overflowY
IconSide iconSide: 3 = IconSide::Left
 see Style::iconSide
AlignItems alignSelf: 3 = AlignItems::Auto
 see Style::alignSelf
BreakBehavior breakBehavior: 2 = BreakBehavior::Auto
 see Style::breakBehavior
bool clampScroll: 1 = true
 see Style::clampScroll
MouseCursor cursor = MouseCursor::Default
 see Style::cursor

Static Public Attributes

static constexpr int16_t kAuto = -1

Detailed Description

The layout part of a registered Style, in pixels; shared by every style with the same values.

StyleManager::GetLayoutStyle returns it.

Member Function Documentation

◆ GetHashCode()

uint64_t tachyon::LayoutStyle::GetHashCode ( ) const
inlinenoexcept

Hash of a subset of the fields, for deduplication; operator== settles collisions.

◆ operator==()

bool tachyon::LayoutStyle::operator== ( const LayoutStyle & other) const
defaultnoexcept

◆ IsInFlow()

bool tachyon::LayoutStyle::IsInFlow ( ) const
inlineconstexpr

Takes part in layout: not display: none and not collapsed.

◆ IsFlexContainer()

bool tachyon::LayoutStyle::IsFlexContainer ( ) const
inlineconstexpr

display is Flex.

◆ GetMinWidth()

int16_t tachyon::LayoutStyle::GetMinWidth ( ) const
inlineconstexpr

Horizontal margin + border + padding: the narrowest the element can be.

◆ GetMinHeight()

int16_t tachyon::LayoutStyle::GetMinHeight ( ) const
inlineconstexpr

Vertical margin + border + padding: the shortest the element can be.

◆ GetMinSize()

short2 tachyon::LayoutStyle::GetMinSize ( ) const
inlineconstexpr

GetMinWidth and GetMinHeight together.

◆ GetPaddingBoxContentRect()

IntRect tachyon::LayoutStyle::GetPaddingBoxContentRect ( const IntRect & borderBox) const
inline

The content box of a border-box rect: borderBox minus border and padding.

◆ GetContentRect()

IntRect tachyon::LayoutStyle::GetContentRect ( const IntRect & outer) const
inline

The content box of a margin-box rect: outer minus margin, border and padding.

◆ GetBorderRect()

IntRect tachyon::LayoutStyle::GetBorderRect ( const IntRect & outer) const
inline

The border box of a margin-box rect: outer minus margin.

◆ GetPaddingRect()

IntRect tachyon::LayoutStyle::GetPaddingRect ( const IntRect & outer) const
inline

The padding box of a margin-box rect: outer minus margin and border.

◆ GetBorderBoxWidth()

int32_t tachyon::LayoutStyle::GetBorderBoxWidth ( ) const
inlinenoexcept

Horizontal padding plus border widths, in pixels.

Member Data Documentation

◆ kAuto

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

◆ margin

BoxEdges tachyon::LayoutStyle::margin {}

pixels

◆ padding

BoxEdges tachyon::LayoutStyle::padding {}

pixels

◆ borderWidths

BoxEdges tachyon::LayoutStyle::borderWidths {}

pixels

◆ layoutData

LayoutData tachyon::LayoutStyle::layoutData {}

flex, grid and size properties, in pixels

◆ textLayoutStyle

TextLayoutStyle tachyon::LayoutStyle::textLayoutStyle {}

◆ iconTextGap

uint16_t tachyon::LayoutStyle::iconTextGap = 0

space between icon and text, pixels

◆ iconSize

uint16_t tachyon::LayoutStyle::iconSize = 0

icon size in pixels; 0 = its natural size

◆ iconOffsetY

int16_t tachyon::LayoutStyle::iconOffsetY = 0

vertical nudge of an icon-only element in pixels; positive = up

◆ display

Display tachyon::LayoutStyle::display

◆ visibility

Visibility tachyon::LayoutStyle::visibility

◆ overflowX

Overflow tachyon::LayoutStyle::overflowX

◆ overflowY

Overflow tachyon::LayoutStyle::overflowY

◆ iconSide

IconSide tachyon::LayoutStyle::iconSide

◆ alignSelf

AlignItems tachyon::LayoutStyle::alignSelf

◆ breakBehavior

BreakBehavior tachyon::LayoutStyle::breakBehavior

◆ clampScroll

bool tachyon::LayoutStyle::clampScroll

◆ cursor

MouseCursor tachyon::LayoutStyle::cursor = MouseCursor::Default

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