slot 0.0.1
A real time UI render framework
载入中...
搜索中...
未找到
Theme.h
浏览该文件的文档.
1#pragma once
2
3#include <DirectXMath.h>
4#include <string>
5
6namespace z8::ui {
7
9enum class WidgetVisualState {
10 Normal,
11 Hovered,
12 Pressed,
16};
17
25 DirectX::XMFLOAT4 Normal;
26 DirectX::XMFLOAT4 Hovered;
27 DirectX::XMFLOAT4 Pressed;
28 DirectX::XMFLOAT4 Selected;
29 DirectX::XMFLOAT4 Disabled;
30 DirectX::XMFLOAT4 Focused;
31
32 const DirectX::XMFLOAT4 &Resolve(WidgetVisualState state) const;
33};
34
37 inline static constexpr float ExtraSmall = 2.0f;
38 inline static constexpr float Small = 4.0f;
39 inline static constexpr float Medium = 6.0f;
40 inline static constexpr float Large = 8.0f;
41};
42
44struct RectStyle {
45 DirectX::XMFLOAT4 Color;
46 DirectX::XMFLOAT4 BorderColor;
47 float BorderWidth = 0.0f;
50 float MinWidth = 30.0f;
51 float MinHeight = 24.0f;
52 float CornerRadius = 0.0f;
53};
54
56struct TextStyle {
57 DirectX::XMFLOAT4 Color;
58 DirectX::XMFLOAT4 MutedColor;
59 DirectX::XMFLOAT4 DisabledColor;
60 std::wstring FontFamily = L"Microsoft YaHei";
61 float FontSize = 14.0f;
62 float SmallFontSize = 12.0f;
63 float HeadingFontSize = 15.0f;
64 float LineHeight = 20.0f;
65};
66
68struct IconStyle {
70 float SmallSize = 12.0f;
71 float NormalSize = 16.0f;
72 float LargeSize = 20.0f;
73};
74
86
99
102 DirectX::XMFLOAT4 TrackColor;
103 DirectX::XMFLOAT4 FillColor;
105 float ControlHeight = 24.0f;
106 float MinimumWidth = 96.0f;
107 float TrackThickness = 4.0f;
108 float ThumbSize = 12.0f;
109 float CornerRadius = 2.0f;
110};
111
116 DirectX::XMFLOAT4 PlaceholderColor;
117 DirectX::XMFLOAT4 BorderColor;
118 DirectX::XMFLOAT4 FocusedBorderColor;
119 DirectX::XMFLOAT4 CaretColor;
120 float ControlHeight = 24.0f;
121 float MinimumWidth = 120.0f;
123 float BorderWidth = 1.0f;
124 float CaretWidth = 1.0f;
125 float CornerRadius = 2.0f;
126};
127
138
154
157 DirectX::XMFLOAT4 Color;
158 DirectX::XMFLOAT4 BorderColor;
159 float Height = 36.0f;
161 float BorderWidth = 1.0f;
162};
163
165struct DockStyle {
166 DirectX::XMFLOAT4 PreviewColor;
167 DirectX::XMFLOAT4 PreviewBorderColor;
168 float PreviewBorderWidth = 2.0f;
169};
170
172struct TabStyle {
176 DirectX::XMFLOAT4 AccentColor;
177 DirectX::XMFLOAT4 SeparatorColor;
178 float Height = 28.0f;
179 float MinWidth = 72.0f;
180 float MaxWidth = 240.0f;
181 float IconSize = 16.0f;
183 float FixedContentWidth = 48.0f;
184 float AccentHeight = 2.0f;
185 float CornerRadius = 0.0f;
186};
187
190 DirectX::XMFLOAT4 TrackColor;
192 float Thickness = 12.0f;
193 float ThumbInset = 3.0f;
194 float MinimumThumbLength = 24.0f;
195 float CornerRadius = 2.0f;
196};
197
200 DirectX::XMFLOAT4 TitleColor;
201 DirectX::XMFLOAT4 TitleActiveColor;
202 DirectX::XMFLOAT4 TitleTextColor;
203 DirectX::XMFLOAT4 ContentSeparatorColor;
204 float TitleHeight = 28.0f;
207 float ResizeBorder = 6.0f;
208};
209
211struct DemoStyle {
212 DirectX::XMFLOAT4 RowColor;
213 DirectX::XMFLOAT4 AlternateRowColor;
214 DirectX::XMFLOAT4 SelectedRowColor;
215 float PanelWidth = 360.0f;
216 float PanelHeight = 320.0f;
217 float RowHeight = 28.0f;
219 float ToolbarHeight = 36.0f;
220 float LeftPanelWidth = 260.0f;
221 float RightPanelWidth = 300.0f;
222 float BottomPanelHeight = 180.0f;
223};
224
251
252} // namespace z8::ui
资源的强类型引用,同时覆盖持久化 ID 与运行时索引两种边界。
Definition ResourceRef.h:36
Definition Application.h:18
WidgetVisualState
Definition Theme.h:9
Definition Theme.h:76
DirectX::XMFLOAT4 BorderColor
Definition Theme.h:79
StateColorStyle BackgroundColor
Definition Theme.h:77
float IconButtonSize
Definition Theme.h:82
float CornerRadius
Definition Theme.h:83
float BorderWidth
Definition Theme.h:80
StateColorStyle ForegroundColor
Definition Theme.h:78
float ContentPadding
Definition Theme.h:84
float ControlHeight
Definition Theme.h:81
Definition Theme.h:211
float BottomPanelHeight
Definition Theme.h:222
float LeftPanelWidth
Definition Theme.h:220
DirectX::XMFLOAT4 AlternateRowColor
Definition Theme.h:213
DirectX::XMFLOAT4 RowColor
Definition Theme.h:212
float RightPanelWidth
Definition Theme.h:221
float PanelHeight
Definition Theme.h:216
float PanelWidth
Definition Theme.h:215
float ToolbarHeight
Definition Theme.h:219
float RowHeight
Definition Theme.h:217
float RowMargin
Definition Theme.h:218
DirectX::XMFLOAT4 SelectedRowColor
Definition Theme.h:214
Definition Theme.h:165
float PreviewBorderWidth
Definition Theme.h:168
DirectX::XMFLOAT4 PreviewBorderColor
Definition Theme.h:167
DirectX::XMFLOAT4 PreviewColor
Definition Theme.h:166
Definition Theme.h:68
float LargeSize
Definition Theme.h:72
float SmallSize
Definition Theme.h:70
StateColorStyle Color
Definition Theme.h:69
float NormalSize
Definition Theme.h:71
Definition Theme.h:140
DirectX::XMFLOAT4 PopupBorderColor
Definition Theme.h:144
float CornerRadius
Definition Theme.h:152
float PopupPadding
Definition Theme.h:149
float PopupWidth
Definition Theme.h:147
StateColorStyle BackgroundColor
Definition Theme.h:141
float BorderWidth
Definition Theme.h:151
DirectX::XMFLOAT4 PopupColor
Definition Theme.h:143
float IconSize
Definition Theme.h:150
float MenuBarHeight
Definition Theme.h:145
float HorizontalPadding
Definition Theme.h:148
float ItemHeight
Definition Theme.h:146
StateColorStyle ForegroundColor
Definition Theme.h:142
Definition Theme.h:199
DirectX::XMFLOAT4 TitleTextColor
Definition Theme.h:202
float TitleHeight
Definition Theme.h:204
float ContentPadding
Definition Theme.h:205
float ContentSeparatorWidth
Definition Theme.h:206
DirectX::XMFLOAT4 TitleColor
Definition Theme.h:200
float ResizeBorder
Definition Theme.h:207
DirectX::XMFLOAT4 TitleActiveColor
Definition Theme.h:201
DirectX::XMFLOAT4 ContentSeparatorColor
Definition Theme.h:203
Definition Theme.h:44
float MinHeight
Definition Theme.h:51
DirectX::XMFLOAT4 Color
Definition Theme.h:45
float BorderWidth
Definition Theme.h:47
DirectX::XMFLOAT4 BorderColor
Definition Theme.h:46
float Margin
Definition Theme.h:48
float MinWidth
Definition Theme.h:50
float Padding
Definition Theme.h:49
float CornerRadius
Definition Theme.h:52
Definition Theme.h:189
DirectX::XMFLOAT4 TrackColor
Definition Theme.h:190
StateColorStyle ThumbColor
Definition Theme.h:191
float Thickness
Definition Theme.h:192
float ThumbInset
Definition Theme.h:193
float CornerRadius
Definition Theme.h:195
float MinimumThumbLength
Definition Theme.h:194
Definition Theme.h:101
DirectX::XMFLOAT4 TrackColor
Definition Theme.h:102
StateColorStyle ThumbColor
Definition Theme.h:104
float CornerRadius
Definition Theme.h:109
float TrackThickness
Definition Theme.h:107
float MinimumWidth
Definition Theme.h:106
float ControlHeight
Definition Theme.h:105
DirectX::XMFLOAT4 FillColor
Definition Theme.h:103
float ThumbSize
Definition Theme.h:108
Definition Theme.h:36
static constexpr float Small
Definition Theme.h:38
static constexpr float Large
Definition Theme.h:40
static constexpr float ExtraSmall
Definition Theme.h:37
static constexpr float Medium
Definition Theme.h:39
Definition Theme.h:24
DirectX::XMFLOAT4 Disabled
Definition Theme.h:29
const DirectX::XMFLOAT4 & Resolve(WidgetVisualState state) const
Definition Theme.cpp:8
DirectX::XMFLOAT4 Focused
Definition Theme.h:30
DirectX::XMFLOAT4 Normal
Definition Theme.h:25
DirectX::XMFLOAT4 Hovered
Definition Theme.h:26
DirectX::XMFLOAT4 Pressed
Definition Theme.h:27
DirectX::XMFLOAT4 Selected
Definition Theme.h:28
Definition Theme.h:172
float Height
Definition Theme.h:178
StateColorStyle BackgroundColor
Definition Theme.h:173
float MinWidth
Definition Theme.h:179
StateColorStyle ForegroundColor
Definition Theme.h:174
DirectX::XMFLOAT4 SeparatorColor
Definition Theme.h:177
float IconMargin
Definition Theme.h:182
float AccentHeight
Definition Theme.h:184
StateColorStyle IconColor
Definition Theme.h:175
float FixedContentWidth
Definition Theme.h:183
float CornerRadius
Definition Theme.h:185
float MaxWidth
Definition Theme.h:180
DirectX::XMFLOAT4 AccentColor
Definition Theme.h:176
float IconSize
Definition Theme.h:181
Definition Theme.h:113
StateColorStyle ForegroundColor
Definition Theme.h:115
float ControlHeight
Definition Theme.h:120
float CaretWidth
Definition Theme.h:124
float BorderWidth
Definition Theme.h:123
DirectX::XMFLOAT4 FocusedBorderColor
Definition Theme.h:118
float ContentPadding
Definition Theme.h:122
DirectX::XMFLOAT4 BorderColor
Definition Theme.h:117
float MinimumWidth
Definition Theme.h:121
DirectX::XMFLOAT4 PlaceholderColor
Definition Theme.h:116
float CornerRadius
Definition Theme.h:125
StateColorStyle BackgroundColor
Definition Theme.h:114
DirectX::XMFLOAT4 CaretColor
Definition Theme.h:119
Definition Theme.h:56
std::wstring FontFamily
Definition Theme.h:60
float LineHeight
Definition Theme.h:64
float FontSize
Definition Theme.h:61
float SmallFontSize
Definition Theme.h:62
float HeadingFontSize
Definition Theme.h:63
DirectX::XMFLOAT4 MutedColor
Definition Theme.h:58
DirectX::XMFLOAT4 DisabledColor
Definition Theme.h:59
DirectX::XMFLOAT4 Color
Definition Theme.h:57
Definition Theme.h:231
TabStyle Tab
Definition Theme.h:243
static const Theme & UnrealEditor()
Definition Theme.cpp:26
ButtonStyle Button
Definition Theme.h:235
DockStyle Dock
Definition Theme.h:242
TextStyle Text
Definition Theme.h:233
ScrollBarStyle ScrollBar
Definition Theme.h:244
static const Theme & Default()
Definition Theme.h:248
TreeViewStyle TreeView
Definition Theme.h:239
SliderStyle Slider
Definition Theme.h:237
ToolBarStyle ToolBar
Definition Theme.h:241
RectStyle Rect
Definition Theme.h:232
DemoStyle Demo
Definition Theme.h:246
TextInputStyle TextInput
Definition Theme.h:238
MenuStyle Menu
Definition Theme.h:240
IconStyle Icon
Definition Theme.h:234
ToggleStyle Toggle
Definition Theme.h:236
PanelStyle Panel
Definition Theme.h:245
Definition Theme.h:88
StateColorStyle ForegroundColor
Definition Theme.h:90
StateColorStyle IndicatorColor
Definition Theme.h:89
DirectX::XMFLOAT4 BorderColor
Definition Theme.h:91
float BorderWidth
Definition Theme.h:93
float IndicatorSize
Definition Theme.h:95
float ContentGap
Definition Theme.h:97
float CornerRadius
Definition Theme.h:96
float ControlHeight
Definition Theme.h:94
DirectX::XMFLOAT4 FocusedBorderColor
Definition Theme.h:92
Definition Theme.h:156
DirectX::XMFLOAT4 Color
Definition Theme.h:157
float Height
Definition Theme.h:159
float BorderWidth
Definition Theme.h:161
DirectX::XMFLOAT4 BorderColor
Definition Theme.h:158
float Padding
Definition Theme.h:160
Definition Theme.h:129
float ContentGap
Definition Theme.h:136
float IconSize
Definition Theme.h:135
StateColorStyle ForegroundColor
Definition Theme.h:131
float RowHeight
Definition Theme.h:133
float Indent
Definition Theme.h:134
StateColorStyle RowColor
Definition Theme.h:130
StateColorStyle IconColor
Definition Theme.h:132