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

What a control shows: a text, an icon or both, and an optional tooltip. More...

#include <gui_controls/gui_content.h>

Public Member Functions

constexpr GUIContent ()=default
constexpr GUIContent (const char *text)
 Text only, from any string type.
constexpr GUIContent (std::string_view text)
 GUIContent (const std::string &text)
constexpr GUIContent (std::string_view text, std::string_view tooltip)
 Text with a tooltip.
constexpr GUIContent (IconID icon, std::string_view text={}, std::string_view tooltip={})
 An icon, optionally with text and a tooltip.

Public Attributes

IconID icon = IconID::Invalid
 Invalid = no icon.
std::string_view text
 empty = no text
std::string_view tooltip
 shown on hover when not empty

Detailed Description

What a control shows: a text, an icon or both, and an optional tooltip.

It converts from a string or an icon, so a control showing one of them takes it as is:

Button("Save", onSave);
Button(saveIcon, onSave);
Button({ saveIcon, "Save", "Write the file to disk" }, onSave);

It refers to its strings, which only need to live for the call.

Constructor & Destructor Documentation

◆ GUIContent() [1/6]

tachyon::GUIContent::GUIContent ( )
constexprdefault

◆ GUIContent() [2/6]

tachyon::GUIContent::GUIContent ( const char * text)
inlineconstexpr

Text only, from any string type.

◆ GUIContent() [3/6]

tachyon::GUIContent::GUIContent ( std::string_view text)
inlineconstexpr

◆ GUIContent() [4/6]

tachyon::GUIContent::GUIContent ( const std::string & text)
inline

◆ GUIContent() [5/6]

tachyon::GUIContent::GUIContent ( std::string_view text,
std::string_view tooltip )
inlineconstexpr

Text with a tooltip.

◆ GUIContent() [6/6]

tachyon::GUIContent::GUIContent ( IconID icon,
std::string_view text = {},
std::string_view tooltip = {} )
inlineconstexpr

An icon, optionally with text and a tooltip.

Member Data Documentation

◆ icon

IconID tachyon::GUIContent::icon = IconID::Invalid

Invalid = no icon.

◆ text

std::string_view tachyon::GUIContent::text

empty = no text

◆ tooltip

std::string_view tachyon::GUIContent::tooltip

shown on hover when not empty


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