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
/// A temporary change in user interface style
#[derive(Copy, Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum StyleVar {
/// Global alpha applies to everything
Alpha(f32),
/// Additional alpha multiplier applied to disabled elements
DisabledAlpha(f32),
/// Padding within a window
WindowPadding([f32; 2]),
/// Rounding radius of window corners
WindowRounding(f32),
/// Thickness of border around windows
WindowBorderSize(f32),
/// Minimum window size
WindowMinSize([f32; 2]),
/// Alignment for title bar text
WindowTitleAlign([f32; 2]),
/// Rounding radius of child window corners
ChildRounding(f32),
/// Thickness of border around child windows
ChildBorderSize(f32),
/// Rounding radius of popup window corners
PopupRounding(f32),
/// Thickness of border around popup/tooltip windows
PopupBorderSize(f32),
/// Padding within a framed rectangle (used by most widgets)
FramePadding([f32; 2]),
/// Rounding radius of frame corners (used by most widgets)
FrameRounding(f32),
/// Rounding radius of image corners (used by Image() and ImageButton() widgets)
ImageRounding(f32),
/// Thickness of border around images
ImageBorderSize(f32),
/// Thickness of border around frames
FrameBorderSize(f32),
/// Horizontal and vertical spacing between widgets/lines
ItemSpacing([f32; 2]),
/// Horizontal and vertical spacing between within elements of a composed widget
ItemInnerSpacing([f32; 2]),
/// Horizontal indentation when e.g. entering a tree node
IndentSpacing(f32),
/// Padding within a table cell
CellPadding([f32; 2]),
/// Width of the vertical scrollbar, height of the horizontal scrollbar
ScrollbarSize(f32),
/// Rounding radius of scrollbar corners
ScrollbarRounding(f32),
/// Padding of scrollbar grab within its frame
ScrollbarPadding(f32),
/// Minimum width/height of a grab box for slider/scrollbar
GrabMinSize(f32),
/// Rounding radius of grabs corners
GrabRounding(f32),
/// Rounding radius of upper corners of tabs
TabRounding(f32),
/// Thickness of border around tabs
TabBorderSize(f32),
/// Minimum tab width before fitting policy shrink is applied
TabMinWidthBase(f32),
/// Minimum tab width after shrinking with the mixed fitting policy
TabMinWidthShrink(f32),
/// Thickness of the tab-bar separator
TabBarBorderSize(f32),
/// Thickness of the selected tab-bar overline
TabBarOverlineSize(f32),
/// Angle of angled table headers, in radians
TableAngledHeadersAngle(f32),
/// Alignment of angled table headers within the cell
TableAngledHeadersTextAlign([f32; 2]),
/// Thickness of tree hierarchy outlines
TreeLinesSize(f32),
/// Rounding radius of tree hierarchy outlines
TreeLinesRounding(f32),
/// Rounding radius of menu items and menus
MenuItemRounding(f32),
/// Rounding radius of selectable items
SelectableRounding(f32),
/// Rounding radius of drag and drop target highlights; negative values use frame rounding
DragDropTargetRounding(f32),
/// Alignment of button text when button is larger than text
ButtonTextAlign([f32; 2]),
/// Alignment of selectable text when selectable is larger than text
SelectableTextAlign([f32; 2]),
/// Thickness of border in `Separator()`
SeparatorSize(f32),
/// Thickness of border in `SeparatorText()`
SeparatorTextBorderSize(f32),
/// Alignment of text within the separator
SeparatorTextAlign([f32; 2]),
/// Padding around text in `SeparatorText()`
SeparatorTextPadding([f32; 2]),
/// Thickness of resizing border between docked windows
DockingSeparatorSize(f32),
}
/// A two-component style variable whose X or Y component can be overridden.
///
/// Use this with [`Ui::push_style_var_x`](crate::Ui::push_style_var_x) or
/// [`Ui::push_style_var_y`](crate::Ui::push_style_var_y). Scalar style
/// variables are intentionally not representable by this type.
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
#[non_exhaustive]
pub enum StyleVarVec2 {
/// Padding within a window.
WindowPadding,
/// Minimum window size.
WindowMinSize,
/// Alignment for title bar text.
WindowTitleAlign,
/// Padding within a framed rectangle.
FramePadding,
/// Horizontal and vertical spacing between widgets or lines.
ItemSpacing,
/// Spacing between elements of a composed widget.
ItemInnerSpacing,
/// Padding within a table cell.
CellPadding,
/// Alignment of angled table headers within the cell.
TableAngledHeadersTextAlign,
/// Alignment of button text when the button is larger than its text.
ButtonTextAlign,
/// Alignment of selectable text when the selectable is larger than its text.
SelectableTextAlign,
/// Alignment of text within a separator.
SeparatorTextAlign,
/// Padding around text in a separator.
SeparatorTextPadding,
}
impl StyleVarVec2 {
pub(crate) const fn raw(self) -> i32 {
match self {
Self::WindowPadding => crate::sys::ImGuiStyleVar_WindowPadding as i32,
Self::WindowMinSize => crate::sys::ImGuiStyleVar_WindowMinSize as i32,
Self::WindowTitleAlign => crate::sys::ImGuiStyleVar_WindowTitleAlign as i32,
Self::FramePadding => crate::sys::ImGuiStyleVar_FramePadding as i32,
Self::ItemSpacing => crate::sys::ImGuiStyleVar_ItemSpacing as i32,
Self::ItemInnerSpacing => crate::sys::ImGuiStyleVar_ItemInnerSpacing as i32,
Self::CellPadding => crate::sys::ImGuiStyleVar_CellPadding as i32,
Self::TableAngledHeadersTextAlign => {
crate::sys::ImGuiStyleVar_TableAngledHeadersTextAlign as i32
}
Self::ButtonTextAlign => crate::sys::ImGuiStyleVar_ButtonTextAlign as i32,
Self::SelectableTextAlign => crate::sys::ImGuiStyleVar_SelectableTextAlign as i32,
Self::SeparatorTextAlign => crate::sys::ImGuiStyleVar_SeparatorTextAlign as i32,
Self::SeparatorTextPadding => crate::sys::ImGuiStyleVar_SeparatorTextPadding as i32,
}
}
}