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

Size of one grid column or row (CSS: -tachyon-grid-column-track / -row-track). More...

#include <gui_core/style/gui_style.h>

Public Types

enum class  Type : uint8_t { Fixed , Fractional , Auto , Default }
 How value is read. More...

Public Member Functions

bool operator== (const GridTrack &other) const noexcept=default

Static Public Member Functions

static constexpr GridTrack Auto ()
 Fits its content.
static constexpr GridTrack Fixed (float value)
 value pixels (CSS px in a Style).
static constexpr GridTrack Fractional (float value, float minPx=0.0f)
 value fr of the free space, on top of max(minPx, content).
static constexpr GridTrack Default ()
 Defers to the element's style (LayoutOverride only).

Public Attributes

Type type = Type::Auto
float value = 1.0f
 Meaning depends on type: pixels for Fixed, fraction for Fractional.
float minPx = 0.0f
 Fractional tracks only: size = max(minPx, content) + fractional share of free space.

Detailed Description

Size of one grid column or row (CSS: -tachyon-grid-column-track / -row-track).

Member Enumeration Documentation

◆ Type

enum class tachyon::GridTrack::Type : uint8_t
strong

How value is read.

Enumerator
Fixed 

value is in pixels (e.g., 100.0f)

Fractional 

fractional unit (e.g., 1.0f = 1fr)

Auto 

fits content

Default 

defers to the element's style (only valid in LayoutOverride)

Member Function Documentation

◆ Auto()

constexpr GridTrack tachyon::GridTrack::Auto ( )
inlinestaticconstexpr

Fits its content.

◆ Fixed()

constexpr GridTrack tachyon::GridTrack::Fixed ( float value)
inlinestaticconstexpr

value pixels (CSS px in a Style).

◆ Fractional()

constexpr GridTrack tachyon::GridTrack::Fractional ( float value,
float minPx = 0.0f )
inlinestaticconstexpr

value fr of the free space, on top of max(minPx, content).

◆ Default()

constexpr GridTrack tachyon::GridTrack::Default ( )
inlinestaticconstexpr

Defers to the element's style (LayoutOverride only).

◆ operator==()

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

Member Data Documentation

◆ type

Type tachyon::GridTrack::type = Type::Auto

◆ value

float tachyon::GridTrack::value = 1.0f

Meaning depends on type: pixels for Fixed, fraction for Fractional.

◆ minPx

float tachyon::GridTrack::minPx = 0.0f

Fractional tracks only: size = max(minPx, content) + fractional share of free space.


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