|
|
| style (style const &) noexcept=delete |
|
| style (style &&) noexcept=delete |
|
style & | operator= (style const &) noexcept=delete |
|
style & | operator= (style &&) noexcept=delete |
|
void | set_name (std::string name) |
|
std::string const & | name () const noexcept |
|
void | set_id (std::string id) |
|
std::string const & | id () const noexcept |
|
void | set_classes (std::vector< std::string > classes) |
|
std::vector< std::string > const & | classes () const noexcept |
|
void | set_parent_path (style_path new_parent_path) noexcept |
|
style_path const & | parent_path () const noexcept |
|
style_path | path () const noexcept |
| style & | operator= (std::string style_string) |
| | Parse the given string to configure this style.
|
|
attributes_from_theme_type const & | attributes_from_theme () const noexcept |
|
void | set_attributes_from_theme (attributes_from_theme_type new_attributes_from_theme) |
|
unit::pixel_density | pixel_density () const noexcept |
|
void | set_pixel_density (unit::pixel_density new_pixel_density) |
|
void | set_pseudo_class (style_pseudo_class new_pseudo_class) |
| void | reload (bool path_has_changed=false) noexcept |
| | Reload the style attributes from the current theme.
|
| template<forward_of< callback_proto > Func> |
| callback_type | subscribe (Func &&func, callback_flags flags=callback_flags::synchronous) noexcept |
| | Add a callback to the style.
|
|
|
unit::pixels_f | width |
|
unit::pixels_f | height |
|
unit::pixels_f | margin_left |
|
unit::pixels_f | margin_bottom |
|
unit::pixels_f | margin_right |
|
unit::pixels_f | margin_top |
|
unit::pixels_f | padding_left |
|
unit::pixels_f | padding_bottom |
|
unit::pixels_f | padding_right |
|
unit::pixels_f | padding_top |
|
unit::pixels_f | border_width |
|
unit::pixels_f | border_bottom_left_radius |
|
unit::pixels_f | border_bottom_right_radius |
|
unit::pixels_f | border_top_left_radius |
|
unit::pixels_f | border_top_right_radius |
|
float | width_px |
|
float | height_px |
|
float | margin_left_px |
|
float | margin_bottom_px |
|
float | margin_right_px |
|
float | margin_top_px |
|
float | padding_left_px |
|
float | padding_bottom_px |
|
float | padding_right_px |
|
float | padding_top_px |
|
float | border_width_px |
|
float | border_bottom_left_radius_px |
|
float | border_bottom_right_radius_px |
|
float | border_top_left_radius_px |
|
float | border_top_right_radius_px |
|
hi::margins | margins_px |
|
hi::margins | padding_px |
|
hi::corner_radii | border_radius_px |
|
hi::horizontal_alignment | horizontal_alignment |
|
hi::vertical_alignment | vertical_alignment |
|
color | foreground_color |
|
color | background_color |
|
color | border_color |
◆ operator=()
| style & hi::v1::style::operator= |
( |
std::string | style_string | ) |
|
|
inline |
Parse the given string to configure this style.
The style_string has the following format:
style_string := (id | class | attribute )*
id := '#' annex-31-minus
class := '.' annex-31-minus
attribute := annex-31-minus '=' value
hex-
color-value :=
'#' [0-9A-Fa-f]{6,8}
rgb-
color-value :=
'rgb_color(' number
',' number
',' number
')'
rgba-
color-value :=
'rgb_color(' number
',' number
',' number
',' number
')'
named-
color-value := annex-31-minus
length-value := number ('pd' | 'px' | 'pt' | 'in' | 'cm')?
@ middle
Align to the vertical-middle.
Definition alignment.hpp:36
@ bottom
Align to the bottom.
Definition alignment.hpp:40
@ top
Align to the top.
Definition alignment.hpp:32
@ justified
Stretch the text to be flush to both sides.
Definition alignment.hpp:130
@ center
Align the text in the center.
Definition alignment.hpp:124
This is a RGBA floating point color.
Definition color_intf.hpp:49
Horizontal/Vertical alignment combination.
Definition alignment.hpp:244
◆ reload()
| void hi::v1::style::reload |
( |
bool | path_has_changed = false | ) |
|
|
inlinenoexcept |
Reload the style attributes from the current theme.
Reload is called automatically after:
- changing the attributes_from_theme function.
- changing the parent of the style (or of its ancestors).
- changing the name, id, classes of a style (or of its ancestors).
But must by called manually for children when the notifier is called with style_modify_mask::path.
◆ subscribe()
template<forward_of< callback_proto > Func>
| callback_type hi::v1::style::subscribe |
( |
Func && | func, |
|
|
callback_flags | flags = callback_flags::synchronous ) |
|
inlinenodiscardnoexcept |
Add a callback to the style.
After the call the caller will take ownership of the returned callback object.
The callback object is a move-only RAII object that will automatically unsubscribe the callback when the token is destroyed.
- Parameters
-
| flags | The callback-flags used to determine how the callback is called. |
| callback | A callable object with prototype void(style_modify_mask, bool) being called when the style changes. The first argument is the mask of which attributes have changed. The second argument is true when the path of the style has changed. |
- Returns
- A RAII object which when destroyed will unsubscribe the callback.
The documentation for this class was generated from the following file: