1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
//! Size tokens for the workbench chrome, in points.
//!
//! Keeping every chrome size in one place stops the title bar, tabs, explorer, and
//! dialogs from drifting apart. The values are stable: they are part of the pixel
//! contract with Crisol 0.1.3 (PIX-MET-01).
//!
//! ```
//! use crisol_core::metrics;
//! ```
/// Glyphs inside dense menus, steppers, and window buttons.
/// # Example
///
/// ```
/// use crisol_core::metrics::ICON_SMALL;
/// ```
pub const ICON_SMALL: f32 = 14.0;
/// Glyphs of title-bar actions, tabs, and tree rows.
/// # Example
///
/// ```
/// use crisol_core::metrics::ICON_MEDIUM;
/// ```
pub const ICON_MEDIUM: f32 = 16.0;
/// The product mark.
/// # Example
///
/// ```
/// use crisol_core::metrics::ICON_LARGE;
/// ```
pub const ICON_LARGE: f32 = 20.0;
/// Height of the title bar.
/// # Example
///
/// ```
/// use crisol_core::metrics::TITLE_HEIGHT;
/// ```
pub const TITLE_HEIGHT: f32 = 34.0;
/// Height of the document tab strip.
/// # Example
///
/// ```
/// use crisol_core::metrics::TAB_HEIGHT;
/// ```
pub const TAB_HEIGHT: f32 = 34.0;
/// Left inset of the first tab in the strip.
/// # Example
///
/// ```
/// use crisol_core::metrics::TAB_STRIP_PADDING;
/// ```
pub const TAB_STRIP_PADDING: f32 = 8.0;
/// Height of the status bar.
/// # Example
///
/// ```
/// use crisol_core::metrics::STATUS_HEIGHT;
/// ```
pub const STATUS_HEIGHT: f32 = 24.0;
/// Height of an explorer tree row.
/// # Example
///
/// ```
/// use crisol_core::metrics::TREE_ROW_HEIGHT;
/// ```
pub const TREE_ROW_HEIGHT: f32 = 21.0;
/// Indentation per tree depth.
/// # Example
///
/// ```
/// use crisol_core::metrics::TREE_INDENT;
/// ```
pub const TREE_INDENT: f32 = 12.0;
/// Width of the expand/collapse slot in front of every tree icon.
/// # Example
///
/// ```
/// use crisol_core::metrics::CHEVRON_SIZE;
/// ```
pub const CHEVRON_SIZE: f32 = 14.0;
/// Default explorer width.
/// # Example
///
/// ```
/// use crisol_core::metrics::SIDEBAR_WIDTH;
/// ```
pub const SIDEBAR_WIDTH: f32 = 260.0;
/// Square title-bar action button.
/// # Example
///
/// ```
/// use crisol_core::metrics::ACTION_BUTTON;
/// ```
pub const ACTION_BUTTON: f32 = 28.0;
/// Square tab-strip tool button.
/// # Example
///
/// ```
/// use crisol_core::metrics::TOOL_BUTTON;
/// ```
pub const TOOL_BUTTON: f32 = 26.0;
/// Square explorer header button.
/// # Example
///
/// ```
/// use crisol_core::metrics::SMALL_BUTTON;
/// ```
pub const SMALL_BUTTON: f32 = 21.0;
/// Width of a window control cell (minimize, maximize, close).
/// # Example
///
/// ```
/// use crisol_core::metrics::WINDOW_BUTTON_WIDTH;
/// ```
pub const WINDOW_BUTTON_WIDTH: f32 = 44.0;
/// Height of a window control cell.
/// # Example
///
/// ```
/// use crisol_core::metrics::WINDOW_BUTTON_HEIGHT;
/// ```
pub const WINDOW_BUTTON_HEIGHT: f32 = 32.0;
/// Height of text fields, dialog buttons, combo boxes, and steppers.
/// # Example
///
/// ```
/// use crisol_core::metrics::CONTROL_HEIGHT;
/// ```
pub const CONTROL_HEIGHT: f32 = 30.0;
/// Height of a context-menu row.
/// # Example
///
/// ```
/// use crisol_core::metrics::MENU_ROW_HEIGHT;
/// ```
pub const MENU_ROW_HEIGHT: f32 = 22.0;
/// Height of a palette or keyboard-menu row.
/// # Example
///
/// ```
/// use crisol_core::metrics::LIST_ROW_HEIGHT;
/// ```
pub const LIST_ROW_HEIGHT: f32 = 26.0;
/// Pixels from the window edge that start a resize on an undecorated window.
/// # Example
///
/// ```
/// use crisol_core::metrics::RESIZE_EDGE;
/// ```
pub const RESIZE_EDGE: f32 = 4.0;
/// Every size token, by its stable name.
///
/// This is the table frozen in `tests/fixtures/metrics/golden-0.1.3.json`.
/// # Example
///
/// ```
/// use crisol_core::metrics::ALL;
/// ```
pub const ALL: = ;
/// Round a size in points to the nearest physical pixel, as `emath` does.
///
/// `round_to_pixels(x)` is `(x * pixels_per_point).round() / pixels_per_point`, so two
/// sizes that land on the same pixel stay equal when rasterized (PIX-MET-02).
/// # Example
///
/// ```
/// use crisol_core::metrics::round_to_pixels;
/// ```