7#include "theme_mode.hpp"
8#include "../required.hpp"
9#include "../text/text_style.hpp"
11#include "../datum.hpp"
12#include "../color/color.hpp"
19 static inline theme *global;
21 static constexpr OperatingSystem operatingSystem = OperatingSystem::Windows;
24 (operatingSystem == OperatingSystem::Windows) ? 30.0f : 20.0f;
29 (operatingSystem == OperatingSystem::Windows) ? 30.0f : 20.0f;
38 float scroll_bar_thickness =
margin * 2.0f;
92 color foregroundColor;
94 color textSelectColor;
96 color incompleteGlyphColor;
106 theme() noexcept = delete;
109 theme &operator=(
theme const &) noexcept = delete;
122 tt_axiom(std::ssize(fillShades) > 0);
123 return fillShades[nesting_level % std::ssize(fillShades)];
132 tt_axiom(std::ssize(borderShades) > 0);
133 return borderShades[nesting_level % std::ssize(borderShades)];
145 level = std::ssize(grayShades) + level;
148 level = std::clamp(level,
ssize_t{0}, std::ssize(grayShades) - 1);
149 return grayShades[level];
157 [[nodiscard]]
float parseFloat(
datum const &data,
char const *name);
158 [[nodiscard]]
bool parseBool(
datum const &data,
char const *name);
160 [[nodiscard]]
color parseColorValue(
datum const &data);
162 [[nodiscard]]
color parseColor(
datum const &data,
char const *name);
164 [[nodiscard]] font_weight parsefont_weight(
datum const &data,
char const *name);
165 [[nodiscard]]
text_style parsetext_style(
datum const &data,
char const *name);
166 void parse(
datum const &data);
169 return fmt::format(
"{}:{}", rhs.name, rhs.mode);
173 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:142
color fillColor(ssize_t nesting_level) const noexcept
Get fill color of elements of widgets and child widgets.
Definition theme.hpp:119
float large_icon_size
Size of icons representing the length of am average word of a label's text.
Definition theme.hpp:74
float small_icon_size
Size of icons that represents the size of label's text.
Definition theme.hpp:66
float height
The height of the larger widgets like buttons, text-input and drop-down-lists.
Definition theme.hpp:54
float borderWidth
The line-width of a border.
Definition theme.hpp:42
float width
The width of the larger widgets and smaller widgets with included labels.
Definition theme.hpp:58
color borderColor(ssize_t nesting_level) const noexcept
Get border color of elements of widgets and child widgets.
Definition theme.hpp:129
float roundingRadius
The rounding radius of boxes with rounded corners.
Definition theme.hpp:46
float maxLabelWidth
Max width of labels in widgets.
Definition theme.hpp:62
float smallSize
The size of small square widgets.
Definition theme.hpp:50
float icon_size
Size of icons extending from the ascender to descender of a label's text.
Definition theme.hpp:70
float margin
Distance between widgets and between widgets and the border of the container.
Definition theme.hpp:33
float toolbarDecorationButtonWidth
The width of a close, minimize, maximize, system menu button.
Definition theme.hpp:28
Definition text_style.hpp:16