7#include "../settings/module.hpp"
8#include "../text/module.hpp"
9#include "../utility/module.hpp"
10#include "../color/module.hpp"
11#include "../geometry/module.hpp"
12#include "../datum.hpp"
18namespace hi::inline
v1 {
23 operating_system operating_system = operating_system::windows;
34 theme_mode mode = theme_mode::light;
36 theme() noexcept = default;
39 theme& operator=(
theme const&) noexcept = default;
48 template<typename T =
hi::margins>
49 [[nodiscard]] constexpr T margin() const noexcept
51 if constexpr (std::is_same_v<T, hi::margins>) {
53 }
else if constexpr (std::is_same_v<T, float>) {
69 template<
typename T = hi::corner_radii>
72 if constexpr (std::is_same_v<T, hi::corner_radii>) {
73 return T{_rounding_radius};
74 }
else if constexpr (std::is_same_v<T, float>) {
75 return _rounding_radius;
83 [[nodiscard]]
constexpr float size() const noexcept
90 [[nodiscard]]
constexpr float large_size() const noexcept
97 [[nodiscard]]
constexpr float icon_size() const noexcept
106 return _large_icon_size;
113 return _label_icon_size;
120 return _baseline_adjustment;
136 [[nodiscard]]
hi::color color(
hi::color original_color, ssize_t nesting_level = 0) const noexcept;
143 float _margin = 5.0f;
147 float _border_width = 1.0f;
151 float _rounding_radius = 4.0f;
159 float _large_size = 19.0f;
163 float _icon_size = 8.0f;
167 float _large_icon_size = 23.0f;
171 float _label_icon_size = 15.0f;
175 float _baseline_adjustment = 9.0f;
177 std::array<
std::vector<
hi::color>, semantic_color_metadata.size()> _colors;
178 std::array<
hi::
text_style, semantic_text_style_metadata.size()> _text_styles;
180 [[nodiscard]]
float parse_float(
datum const& data,
char const *object_name);
181 [[nodiscard]]
long long parse_long_long(
datum const& data,
char const *object_name);
182 [[nodiscard]]
int parse_int(
datum const& data,
char const *object_name);
183 [[nodiscard]]
bool parse_bool(
datum const& data,
char const *object_name);
184 [[nodiscard]]
std::
string parse_string(
datum const& data,
char const *object_name);
185 [[nodiscard]]
hi::color parse_color_value(
datum const& data);
186 [[nodiscard]]
hi::color parse_color(
datum const& data,
char const *object_name);
187 [[nodiscard]]
std::vector<
hi::color> parse_color_list(
datum const& data,
char const *object_name);
189 [[nodiscard]]
font_weight parse_font_weight(
datum const& data,
char const *object_name);
193 [[nodiscard]] friend
std::
string to_string(
theme const& rhs) noexcept
195 return std::format(
"{}:{}", rhs.name, rhs.mode);
200 return lhs << to_string(rhs);
#define hi_static_not_implemented(...)
This part of the code has not been implemented yet.
Definition assert.hpp:342
semantic_color
Semantic colors.
Definition semantic_color.hpp:20
DOXYGEN BUG.
Definition algorithm.hpp:13
font_weight
Definition font_weight.hpp:16
geometry/margins.hpp
Definition cache.hpp:11
This is a RGBA floating point color.
Definition color.hpp:42
A dynamic data type.
Definition datum.hpp:219
font_book keeps track of multiple fonts.
Definition font_book.hpp:31
The left, bottom, right and top margins.
Definition margins.hpp:20
constexpr float large_size() const noexcept
The size of large widgets.
Definition theme.hpp:90
constexpr float baseline_adjustment() const noexcept
The amount the base-line needs to be moved downwards when a label is aligned to top.
Definition theme.hpp:118
constexpr float label_icon_size() const noexcept
Size of icons being inline with a label's text.
Definition theme.hpp:111
constexpr T rounding_radius() const noexcept
The rounding radius of boxes with rounded corners.
Definition theme.hpp:70
constexpr float large_icon_size() const noexcept
Size of icons representing the length of am average word of a label's text.
Definition theme.hpp:104
theme transform(float dpi) const noexcept
Create a transformed copy of the theme.
constexpr float border_width() const noexcept
The line-width of a border.
Definition theme.hpp:62
constexpr float size() const noexcept
The size of small square widgets.
Definition theme.hpp:83
constexpr float icon_size() const noexcept
Size of icons inside a widget.
Definition theme.hpp:97
Definition text_style.hpp:172