6#include "TTauri/Foundation/required.hpp"
7#include "TTauri/Foundation/mat.hpp"
8#include "TTauri/Text/TextStyle.hpp"
9#include "TTauri/GUI/ThemeMode.hpp"
21 static constexpr OperatingSystem operatingSystem = OperatingSystem::Windows;
23 static inline float toolbarHeight =
24 (operatingSystem == OperatingSystem::Windows) ? 30.0f : 20.0f;
29 (operatingSystem == OperatingSystem::Windows) ? 30.0f : 20.0f;
33 static constexpr float margin = 6.0f;
57 static constexpr float height = 22.0f;
61 static constexpr float width = 50.0f;
90 vec incompleteGlyphColor;
100 Theme() noexcept = delete;
103 Theme &operator=(
Theme const &) noexcept = delete;
114 tt_assume(nestingLevel >= 0);
115 tt_assume(ssize(fillShades) > 0);
116 return fillShades[nestingLevel % ssize(fillShades)];
123 tt_assume(nestingLevel >= 0);
124 tt_assume(ssize(borderShades) > 0);
125 return borderShades[nestingLevel % ssize(borderShades)];
136 level = ssize(grayShades) + level;
139 level = std::clamp(level,
ssize_t{0}, ssize(grayShades) - 1);
140 return grayShades[level];
144 [[nodiscard]]
float parseFloat(
datum const &data,
char const *name);
145 [[nodiscard]]
bool parseBool(
datum const &data,
char const *name);
147 [[nodiscard]]
vec parseColorValue(
datum const &data);
149 [[nodiscard]]
vec parseColor(
datum const &data,
char const *name);
151 [[nodiscard]] FontWeight parseFontWeight(
datum const &data,
char const *name);
152 [[nodiscard]]
TextStyle parseTextStyle(
datum const &data,
char const *name);
153 void parse(
datum const &data);
156 return fmt::format(
"{}:{}", rhs.name, rhs.mode);
160 return lhs << to_string(rhs);
A 4D vector.
Definition vec.hpp:37
static constexpr float iconSize
Size of icons in buttons, based on the original 1EM.
Definition Theme.hpp:69
static constexpr float smallHeight
The height of smaller widget like labels, toggles, checkboxes and radio buttons.
Definition Theme.hpp:47
static constexpr float width
The width of the larger widgets and smaller widgets with included labels.
Definition Theme.hpp:61
static constexpr float maxLabelWidth
Max width of labels in widgets.
Definition Theme.hpp:65
static constexpr float roundingRadius
The rounding radius of boxes with rounded corners.
Definition Theme.hpp:43
vec fillColor(ssize_t nestingLevel) const noexcept
Get fill color of elements of widgets and child widgets.
Definition Theme.hpp:113
static constexpr float smallWidth
The width of smaller widget like labels, toggles, checkboxes and radio buttons.
Definition Theme.hpp:53
static float toolbarDecorationButtonWidth
The width of a close, minimize, maximize, system menu button.
Definition Theme.hpp:28
static constexpr float margin
Distance between widgets and between widgets and the border of the container.
Definition Theme.hpp:33
static constexpr float borderWidth
The line-width of a border.
Definition Theme.hpp:39
vec gray(ssize_t level) const noexcept
Get grey scale color This color is reversed between light and dark themes.
Definition Theme.hpp:134
static constexpr float height
The height of the larger widgets like buttons, text-input and drop-down-lists.
Definition Theme.hpp:57
vec borderColor(ssize_t nestingLevel) const noexcept
Get border color of elements of widgets and child widgets.
Definition Theme.hpp:122
Definition TextStyle.hpp:15