7#include "theme_mode.hpp"
8#include "../text/semantic_text_style.hpp"
9#include "../text/text_style.hpp"
10#include "../utility/module.hpp"
11#include "../datum.hpp"
12#include "../color/module.hpp"
13#include "../geometry/module.hpp"
19namespace hi::inline
v1 {
24 operating_system operating_system = operating_system::windows;
35 theme_mode mode = theme_mode::light;
37 theme() noexcept = default;
40 theme& operator=(
theme const&) noexcept = default;
49 template<typename T =
hi::marginsi>
50 [[nodiscard]] constexpr T margin() const noexcept
52 if constexpr (std::is_same_v<T, hi::marginsi>) {
55 return narrow_cast<T>(_margin);
61 template<arithmetic T =
int>
64 return narrow_cast<T>(_border_width);
69 template<
typename T = hi::corner_radii>
72 if constexpr (std::is_same_v<T, hi::corner_radii>) {
73 return T{narrow_cast<float>(_rounding_radius)};
75 return narrow_cast<T>(_rounding_radius);
81 template<arithmetic T =
int>
82 [[nodiscard]]
constexpr T
size() const noexcept
84 return narrow_cast<T>(_size);
89 template<arithmetic T =
int>
92 return narrow_cast<T>(_large_size);
97 template<arithmetic T =
int>
98 [[nodiscard]]
constexpr T
icon_size() const noexcept
100 return narrow_cast<T>(_icon_size);
105 template<arithmetic T =
int>
108 return narrow_cast<T>(_large_icon_size);
113 template<arithmetic T =
int>
116 return narrow_cast<T>(_label_icon_size);
121 template<arithmetic T =
int>
124 return narrow_cast<T>(_baseline_adjustment);
140 [[nodiscard]]
hi::color color(
hi::color original_color, ssize_t nesting_level = 0) const noexcept;
151 int _border_width = 1;
155 int _rounding_radius = 4;
163 int _large_size = 19;
171 int _large_icon_size = 23;
175 int _label_icon_size = 15;
179 int _baseline_adjustment = 9;
181 std::array<
std::vector<
hi::color>, semantic_color_metadata.size()> _colors;
182 std::array<
hi::
text_style, semantic_text_style_metadata.size()> _text_styles;
184 [[nodiscard]]
float parse_float(
datum const& data,
char const *object_name);
185 [[nodiscard]]
long long parse_long_long(
datum const& data,
char const *object_name);
186 [[nodiscard]]
int parse_int(
datum const& data,
char const *object_name);
187 [[nodiscard]]
bool parse_bool(
datum const& data,
char const *object_name);
188 [[nodiscard]]
std::
string parse_string(
datum const& data,
char const *object_name);
189 [[nodiscard]]
hi::color parse_color_value(
datum const& data);
190 [[nodiscard]]
hi::color parse_color(
datum const& data,
char const *object_name);
191 [[nodiscard]]
std::vector<
hi::color> parse_color_list(
datum const& data,
char const *object_name);
193 [[nodiscard]]
font_weight parse_font_weight(
datum const& data,
char const *object_name);
197 [[nodiscard]] friend
std::
string to_string(
theme const& rhs) noexcept
199 return std::format(
"{}:{}", rhs.name, rhs.mode);
204 return lhs << to_string(rhs);
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
constexpr T rounding_radius() const noexcept
The rounding radius of boxes with rounded corners.
Definition theme.hpp:70
constexpr T label_icon_size() const noexcept
Size of icons being inline with a label's text.
Definition theme.hpp:114
constexpr T icon_size() const noexcept
Size of icons inside a widget.
Definition theme.hpp:98
theme transform(float dpi) const noexcept
Create a transformed copy of the theme.
constexpr T large_icon_size() const noexcept
Size of icons representing the length of am average word of a label's text.
Definition theme.hpp:106
constexpr T large_size() const noexcept
The size of large widgets.
Definition theme.hpp:90
constexpr T baseline_adjustment() const noexcept
The amount the base-line needs to be moved downwards when a label is aligned to top.
Definition theme.hpp:122
constexpr T size() const noexcept
The size of small square widgets.
Definition theme.hpp:82
constexpr T border_width() const noexcept
The line-width of a border.
Definition theme.hpp:62
Definition text_style.hpp:173