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

#include <hikogui/l10n/label.hpp>

Public Member Functions

template<std::convertible_to< hi::icon > Icon, std::convertible_to< txt > Txt>
constexpr label (Icon &&icon, Txt &&text) noexcept
 Construct a new label from an icon and text.
 
template<std::convertible_to< txt > Txt>
constexpr label (Txt &&text) noexcept
 Construct a new label from text.
 
template<std::convertible_to< hi::icon > Icon>
constexpr label (Icon &&icon) noexcept
 Construct a new label from an icon.
 
constexpr label () noexcept
 Construct a empty label.
 
 label (label const &other) noexcept=default
 
labeloperator= (label const &other) noexcept=default
 
 label (label &&other) noexcept=default
 
labeloperator= (label &&other) noexcept=default
 
constexpr bool empty () const noexcept
 
constexpr operator bool () const noexcept
 

Data Fields

hi::icon icon
 The icon.
 
txt text
 Localizable text.
 

Friends

constexpr friend bool operator== (label const &, label const &) noexcept=default
 Compare if both labels are equal.
 

Detailed Description

A label consisting of localizable text and an icon.

A label is used for user-visible information. The label is used as information displayed by the label_widget.

The audio subsystem will use labels to return user-visible information such as the name of audio device end-points or surround sound speaker configuration which in both cases includes icons and text that needs to be translated.

Constructor & Destructor Documentation

◆ label() [1/4]

template<std::convertible_to< hi::icon > Icon, std::convertible_to< txt > Txt>
constexpr v1::label::label ( Icon && icon,
Txt && text )
inlineconstexprnoexcept

Construct a new label from an icon and text.

Parameters
iconThe icon.
textThe text.

◆ label() [2/4]

template<std::convertible_to< txt > Txt>
constexpr v1::label::label ( Txt && text)
inlineconstexprnoexcept

Construct a new label from text.

Parameters
textThe text.

◆ label() [3/4]

template<std::convertible_to< hi::icon > Icon>
constexpr v1::label::label ( Icon && icon)
inlineconstexprnoexcept

Construct a new label from an icon.

Parameters
iconThe icon.

◆ label() [4/4]

constexpr v1::label::label ( )
inlineconstexprnoexcept

Construct a empty label.

Friends And Related Symbol Documentation

◆ operator==

constexpr friend bool operator== ( label const & ,
label const &  )
friend

Compare if both labels are equal.

Parameters
lhsA label.
rhsA label.
Returns
True is the text and icon of both labels are equal.

Field Documentation

◆ icon

hi::icon v1::label::icon

The icon.

◆ text

txt v1::label::text

Localizable text.

The text in this field is not yet translated nor formatted.


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