HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions
tt::label_stencil Class Reference
Inheritance diagram for tt::label_stencil:
tt::stencil

Public Member Functions

 label_stencil (alignment alignment, label label, text_style style) noexcept
 
f32x4 preferred_extent () noexcept override
 Return the extent that this cell wants to be drawn as.
 
bool show_icon () const noexcept
 Whether the text in the label will align to an optional icon in the label.
 
void set_show_icon (bool flag) noexcept
 Set the show_icon() flag.
 
void set_layout_parameters (aarect const &rectangle, float base_line_position=std::numeric_limits< float >::infinity()) noexcept override
 Pass layout parameters in local coordinates.
 
void draw (draw_context context, bool use_context_color=false) noexcept override
 Draw the cell.
 
- Public Member Functions inherited from tt::stencil
 stencil (alignment alignment)
 
 stencil (stencil const &) noexcept=delete
 
 stencil (stencil &&) noexcept=delete
 
stenciloperator= (stencil const &) noexcept=delete
 
stenciloperator= (stencil &&) noexcept=delete
 

Additional Inherited Members

- Static Public Member Functions inherited from tt::stencil
static std::unique_ptr< class image_stencilmake_unique (alignment alignment, icon const &icon)
 
static std::unique_ptr< class text_stencilmake_unique (alignment alignment, std::u8string const &text, text_style const &style)
 
static std::unique_ptr< class label_stencilmake_unique (alignment alignment, tt::label const &label, text_style const &style)
 

Member Function Documentation

◆ draw()

void tt::label_stencil::draw ( draw_context context,
bool use_context_color = false )
inlineoverridevirtualnoexcept

Draw the cell.

Parameters
contextThe current draw context.
use_context_colorTrue to use the colors in the context, False to use the colors in the cell itself.

Implements tt::stencil.

◆ preferred_extent()

f32x4 tt::label_stencil::preferred_extent ( )
inlineoverridevirtualnoexcept

Return the extent that this cell wants to be drawn as.

Reimplemented from tt::stencil.

◆ set_layout_parameters()

void tt::label_stencil::set_layout_parameters ( aarect const & rectangle,
float base_line_position = std::numeric_limits<float>::infinity() )
inlineoverridevirtualnoexcept

Pass layout parameters in local coordinates.

Parameters
rectangleThe rectangle the stencil will be drawn into.
base_line_positionThe position of the base line within the rectangle.

Reimplemented from tt::stencil.

◆ set_show_icon()

void tt::label_stencil::set_show_icon ( bool flag)
inlinenoexcept

Set the show_icon() flag.

◆ show_icon()

bool tt::label_stencil::show_icon ( ) const
inlinenoexcept

Whether the text in the label will align to an optional icon in the label.

Make space for, and optionally display, an icon in front of the text. This option should be used when any of the labels in a menu has an icon.

This should not be used when a menu is displayed in the same direction as the icon label. For example a left or right aligned menu item in a row menu; such as the tool-bar.

Return values
trueThe text of the label will be aligned after an optional icon of the label.
falseThe text of the label will be not be aligned to an optional icon of the label.

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