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
use ;
use UiDensity;
use derive_dynamic_spacing;
// Derives [DynamicSpacing]. See [ui_macros::derive_dynamic_spacing].
//
// There are 3 UI density settings: Compact, Default, and Comfortable.
//
// When a tuple of three values is provided, the values are used directly.
//
// Example: (1, 2, 4) => Compact: 1px, Default: 2px, Comfortable: 4px
//
// When a single value is provided, the standard spacing formula is
// used to derive the of spacing values. This formula can be found in
// the macro.
//
// Example:
//
// Assuming the standard formula is (n-4, n, n+4)
//
// 24 => Compact: 20px, Default: 24px, Comfortable: 28px
//
// The [DynamicSpacing] enum variants use a BaseXX format,
// where XX = the pixel value @ default rem size and the default UI density.
//
// Example:
//
// DynamicSpacing::Base16 would return 16px at the default UI scale & density.
derive_dynamic_spacing!;
/// Returns the current [`UiDensity`] setting. Use this to
/// modify or show something in the UI other than spacing.
///
/// Do not use this to calculate spacing values.
///
/// Always use [DynamicSpacing] for spacing values.