-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcimgui_toggle_presets.cpp
More file actions
65 lines (51 loc) · 2.69 KB
/
cimgui_toggle_presets.cpp
File metadata and controls
65 lines (51 loc) · 2.69 KB
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
#include "imgui_toggle_presets.h"
#include "imgui.h"
extern "C" {
// ImGuiTogglePresets: A few canned configurations for various presets OOTB.
// The default, unmodified style.
ImGuiToggleConfig ImGuiTogglePresets_DefaultStyle(void){
return ImGuiTogglePresets::DefaultStyle();
}
// A style similar to default, but with rectangular knob and frame.
ImGuiToggleConfig ImGuiTogglePresets_RectangleStyle(void){
return ImGuiTogglePresets::RectangleStyle();
}
// A style that uses a shadow to appear to glow while it's on.
ImGuiToggleConfig ImGuiTogglePresets_GlowingStyle(void){
return ImGuiTogglePresets::GlowingStyle();
}
// A style that emulates what a toggle on iOS looks like.
//ImGuiToggleConfig ImGuiTogglePresets_iOSStyle(float size_scale = 1.0f, bool light_mode = false){
ImGuiToggleConfig ImGuiTogglePresets_iOSStyle(float size_scale , bool light_mode ){
return ImGuiTogglePresets::iOSStyle(size_scale, light_mode);
}
// A style that emulates what a Material Design toggle looks like.
//ImGuiToggleConfig ImGuiTogglePresets_MaterialStyle(float size_scale = 1.0f){
ImGuiToggleConfig ImGuiTogglePresets_MaterialStyle(float size_scale ){
return ImGuiTogglePresets::MaterialStyle(size_scale);
}
// A style that emulates what a toggle close to one from Minecraft.
//ImGuiToggleConfig ImGuiTogglePresets_MinecraftStyle(float size_scale = 1.0f){
ImGuiToggleConfig ImGuiTogglePresets_MinecraftStyle(float size_scale){
return ImGuiTogglePresets::MinecraftStyle(size_scale);
}
void ImGuiToggleConfig_init(ImGuiToggleConfig* config){
config->Flags = ImGuiToggleFlags_Default;
// What style of A11y glyph to draw on the widget.
config->A11yStyle = ImGuiToggleA11yStyle_Default;
// The a duration in seconds that the toggle should animate for. If 0, animation will be disabled.
config->AnimationDuration = ImGuiToggleConstants::AnimationDurationDefault;
// A scalar that controls how rounded the toggle frame is. 0 is square, 1 is round. (0, 1) default 1.0f
config->FrameRounding = ImGuiToggleConstants::FrameRoundingDefault;
//A scalar that controls how rounded the toggle knob is. 0 is square, 1 is round. (0, 1) default 1.0f
config->KnobRounding = ImGuiToggleConstants::KnobRoundingDefault;
// A ratio that controls how wide the toggle is compared to it's height. If `Size.x` is non-zero, this value is ignored.
config->WidthRatio = ImGuiToggleConstants::WidthRatioDefault;
// A custom size to draw the toggle with. Defaults to (0, 0). If `Size.x` is zero, `WidthRatio` will control the toggle width.
// If `Size.y` is zero, the toggle height will be set by `ImGui::GetFrameHeight()`.
ImVec2 vec2;
vec2.x = 0.0f;
vec2.y = 0.0f;
config->Size = vec2;
}
} // extern "C"