7#include "theme_mode.hpp"
8#include "../required.hpp"
9#include "../text/text_style.hpp"
11#include "../numeric_array.hpp"
12#include "../datum.hpp"
13#include "../color/color.hpp"
20 static inline theme *global;
22 static constexpr OperatingSystem operatingSystem = OperatingSystem::Windows;
25 (operatingSystem == OperatingSystem::Windows) ? 30.0f : 20.0f;
30 (operatingSystem == OperatingSystem::Windows) ? 30.0f : 20.0f;
39 float scroll_bar_thickness =
margin * 2.0f;
93 color foregroundColor;
95 color textSelectColor;
97 color incompleteGlyphColor;
107 theme() noexcept = delete;
110 theme &operator=(
theme const &) noexcept = delete;
123 tt_axiom(std::ssize(fillShades) > 0);
124 return fillShades[nesting_level % std::ssize(fillShades)];
133 tt_axiom(std::ssize(borderShades) > 0);
134 return borderShades[nesting_level % std::ssize(borderShades)];
146 level = std::ssize(grayShades) + level;
149 level = std::clamp(level,
ssize_t{0}, std::ssize(grayShades) - 1);
150 return grayShades[level];
158 [[nodiscard]]
float parseFloat(
datum const &data,
char const *name);
159 [[nodiscard]]
bool parseBool(
datum const &data,
char const *name);
161 [[nodiscard]]
color parseColorValue(
datum const &data);
163 [[nodiscard]]
color parseColor(
datum const &data,
char const *name);
165 [[nodiscard]] font_weight parsefont_weight(
datum const &data,
char const *name);
166 [[nodiscard]]
text_style parsetext_style(
datum const &data,
char const *name);
167 void parse(
datum const &data);
170 return fmt::format(
"{}:{}", rhs.name, rhs.mode);
174 return lhs << to_string(rhs);
This is a RGBA floating point color.
Definition color.hpp:39
color gray(ssize_t level) const noexcept
Get grey scale color This color is reversed between light and dark themes.
Definition theme.hpp:143
color fillColor(ssize_t nesting_level) const noexcept
Get fill color of elements of widgets and child widgets.
Definition theme.hpp:120
float large_icon_size
Size of icons representing the length of am average word of a label's text.
Definition theme.hpp:75
float small_icon_size
Size of icons that represents the size of label's text.
Definition theme.hpp:67
float height
The height of the larger widgets like buttons, text-input and drop-down-lists.
Definition theme.hpp:55
float borderWidth
The line-width of a border.
Definition theme.hpp:43
float width
The width of the larger widgets and smaller widgets with included labels.
Definition theme.hpp:59
color borderColor(ssize_t nesting_level) const noexcept
Get border color of elements of widgets and child widgets.
Definition theme.hpp:130
float roundingRadius
The rounding radius of boxes with rounded corners.
Definition theme.hpp:47
float maxLabelWidth
Max width of labels in widgets.
Definition theme.hpp:63
float smallSize
The size of small square widgets.
Definition theme.hpp:51
float icon_size
Size of icons extending from the ascender to descender of a label's text.
Definition theme.hpp:71
float margin
Distance between widgets and between widgets and the border of the container.
Definition theme.hpp:34
float toolbarDecorationButtonWidth
The width of a close, minimize, maximize, system menu button.
Definition theme.hpp:29
Definition text_style.hpp:16