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

Public Member Functions

 theme (theme const &) noexcept=default
 
 theme (theme &&) noexcept=default
 
themeoperator= (theme const &) noexcept=default
 
themeoperator= (theme &&) noexcept=default
 
 theme (std::filesystem::path const &path)
 Open and parse a theme file.
 
template<typename T = hi::margins>
constexpr T margin () const noexcept
 Distance between widgets and between widgets and the border of the container.
 
constexpr float border_width () const noexcept
 The line-width of a border.
 
template<typename T = hi::corner_radii>
constexpr T rounding_radius () const noexcept
 The rounding radius of boxes with rounded corners.
 
constexpr float size () const noexcept
 The size of small square widgets.
 
constexpr float large_size () const noexcept
 The size of large widgets.
 
constexpr float icon_size () const noexcept
 Size of icons inside a widget.
 
constexpr float large_icon_size () const noexcept
 Size of icons representing the length of am average word of a label's text.
 
constexpr float label_icon_size () const noexcept
 Size of icons being inline with a label's text.
 
constexpr float baseline_adjustment () const noexcept
 The amount the base-line needs to be moved downwards when a label is aligned to top.
 
theme transform (hi::pixel_density new_pixel_density) const noexcept
 Create a transformed copy of the theme.
 
hi::color color (hi::semantic_color original_color, ssize_t nesting_level=0) const noexcept
 
hi::color color (hi::color original_color, ssize_t nesting_level=0) const noexcept
 
hi::text_style text_style (semantic_text_style theme_color) const noexcept
 
hi::text_style text_style (hi::text_style original_style) const noexcept
 

Data Fields

hi::pixel_density pixel_density = hi::pixel_density{pixels_per_inch(72.0f), device_type::desktop}
 The PPI of the size values.
 
std::string name
 
theme_mode mode = theme_mode::light
 

Friends

std::string to_string (theme const &rhs) noexcept
 
std::ostreamoperator<< (std::ostream &lhs, theme const &rhs)
 

Constructor & Destructor Documentation

◆ theme()

v1::theme::theme ( std::filesystem::path const & path)
inline

Open and parse a theme file.

Member Function Documentation

◆ baseline_adjustment()

constexpr float v1::theme::baseline_adjustment ( ) const
inlineconstexprnoexcept

The amount the base-line needs to be moved downwards when a label is aligned to top.

◆ border_width()

constexpr float v1::theme::border_width ( ) const
inlineconstexprnoexcept

The line-width of a border.

◆ icon_size()

constexpr float v1::theme::icon_size ( ) const
inlineconstexprnoexcept

Size of icons inside a widget.

◆ label_icon_size()

constexpr float v1::theme::label_icon_size ( ) const
inlineconstexprnoexcept

Size of icons being inline with a label's text.

◆ large_icon_size()

constexpr float v1::theme::large_icon_size ( ) const
inlineconstexprnoexcept

Size of icons representing the length of am average word of a label's text.

◆ large_size()

constexpr float v1::theme::large_size ( ) const
inlineconstexprnoexcept

The size of large widgets.

Such as the minimum scroll bar size.

◆ margin()

template<typename T = hi::margins>
constexpr T v1::theme::margin ( ) const
inlineconstexprnoexcept

Distance between widgets and between widgets and the border of the container.

◆ rounding_radius()

template<typename T = hi::corner_radii>
constexpr T v1::theme::rounding_radius ( ) const
inlineconstexprnoexcept

The rounding radius of boxes with rounded corners.

◆ size()

constexpr float v1::theme::size ( ) const
inlineconstexprnoexcept

The size of small square widgets.

◆ transform()

theme v1::theme::transform ( hi::pixel_density new_pixel_density) const
inlinenoexcept

Create a transformed copy of the theme.

This function is used by the window, to make a specific version of the theme scaled to the PPI of the window.

It can also create a different version when the window becomes active/inactive mostly this will desaturate the colors in the theme.

Parameters
new_ppiThe PPI of the window.

Field Documentation

◆ pixel_density

hi::pixel_density v1::theme::pixel_density = hi::pixel_density{pixels_per_inch(72.0f), device_type::desktop}

The PPI of the size values.


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