HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Friends
v1::widget_baseline Class Reference

#include <hikogui/widgets/widget_baseline.hpp>

Public Member Functions

constexpr widget_baseline (widget_baseline const &) noexcept=default
 
constexpr widget_baseline (widget_baseline &&) noexcept=default
 
constexpr widget_baselineoperator= (widget_baseline const &) noexcept=default
 
constexpr widget_baselineoperator= (widget_baseline &&) noexcept=default
 
constexpr widget_baseline (float priority, vertical_alignment alignment, float cap_height, float graphic_height=0.0f) noexcept
 Construct a widget base-line.
 
constexpr widget_baseline (float priority, float gain, float bias) noexcept
 Construct a widget base-line.
 
constexpr auto friend operator<=> (widget_baseline const &lhs, widget_baseline const &rhs) noexcept
 
constexpr bool empty () const noexcept
 
 operator bool () const noexcept
 
constexpr float absolute (float height) const noexcept
 Calculate the absolute base-line.
 

Friends

constexpr friend bool operator== (widget_baseline const &, widget_baseline const &) noexcept=default
 

Detailed Description

The base-line of a widget on which to set the text and graphics.

Constructor & Destructor Documentation

◆ widget_baseline() [1/2]

constexpr v1::widget_baseline::widget_baseline ( float priority,
vertical_alignment alignment,
float cap_height,
float graphic_height = 0.0f )
inlineconstexprnoexcept

Construct a widget base-line.

Parameters
priorityThe priority of the widget for dictating the baseline.
alignmentThe alignment of the widget.
cap_heightThe capital height of the default label font.
graphic_heightThe height of the graphics of the widget where the text is beside or inside.

◆ widget_baseline() [2/2]

constexpr v1::widget_baseline::widget_baseline ( float priority,
float gain,
float bias )
inlineconstexprnoexcept

Construct a widget base-line.

Parameters
priorityHow sure a widget is that its base-line should be used. 0.0: bad, 0.1: text label, 0.5 small widget, 1.0 large widget.
gainThe relative position of the base-line compared to the height of the widget.
biasThe absolute offset of the base-line.

Member Function Documentation

◆ absolute()

constexpr float v1::widget_baseline::absolute ( float height) const
inlineconstexprnoexcept

Calculate the absolute base-line.

Parameters
heightThe height of the widget.
Returns
height * gain + bias.

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