forked from AllenDang/giu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
StyleIDs.go
150 lines (140 loc) · 10.3 KB
/
StyleIDs.go
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
package giu
import "github.com/AllenDang/imgui-go"
// Here are the style IDs for styling imgui apps.
// For details about each of attributes read comment above them.
// go-generate String() andStringToEnum methods
//go:generate stringer -type=StyleColorID,StyleVarID -output=StyleIDs_string.go -linecomment
// NOTE: string2enum is https://github.com/mewspring/tools
//go:generate string2enum -samepkg -type=StyleColorID,StyleVarID -output=StyleIDs_string2enum.go -linecomment
// StyleColorID identifies a color in the UI style.
type StyleColorID imgui.StyleColorID
// StyleColor identifier.
// NOTE: comments are used for CSS conversion and are generated by stringer and string2enum.
const (
StyleColorText = StyleColorID(imgui.StyleColorText) // color
StyleColorTextDisabled = StyleColorID(imgui.StyleColorTextDisabled) // disabled-color
StyleColorWindowBg = StyleColorID(imgui.StyleColorWindowBg) // background-color
StyleColorChildBg = StyleColorID(imgui.StyleColorChildBg) // child-background-color
StyleColorPopupBg = StyleColorID(imgui.StyleColorPopupBg) // popup-background-color
StyleColorBorder = StyleColorID(imgui.StyleColorBorder) // border-color
StyleColorBorderShadow = StyleColorID(imgui.StyleColorBorderShadow) // border-shadow-color
StyleColorFrameBg = StyleColorID(imgui.StyleColorFrameBg) // frame-background-color
StyleColorFrameBgHovered = StyleColorID(imgui.StyleColorFrameBgHovered) // frame-background-hovered-color
StyleColorFrameBgActive = StyleColorID(imgui.StyleColorFrameBgActive) // frame-background-active-color
StyleColorTitleBg = StyleColorID(imgui.StyleColorTitleBg) // title-background-color
StyleColorTitleBgActive = StyleColorID(imgui.StyleColorTitleBgActive) // title-background-active-color
StyleColorTitleBgCollapsed = StyleColorID(imgui.StyleColorTitleBgCollapsed) // title-background-collapsed-color
StyleColorMenuBarBg = StyleColorID(imgui.StyleColorMenuBarBg) // menu-bar-background-color
StyleColorScrollbarBg = StyleColorID(imgui.StyleColorScrollbarBg) // scrollbar-background-color
StyleColorScrollbarGrab = StyleColorID(imgui.StyleColorScrollbarGrab) // scrollbar-grab-color
StyleColorScrollbarGrabHovered = StyleColorID(imgui.StyleColorScrollbarGrabHovered) // scrollbar-grab-hovered-color
StyleColorScrollbarGrabActive = StyleColorID(imgui.StyleColorScrollbarGrabActive) // scrollbar-grab-active-color
StyleColorCheckMark = StyleColorID(imgui.StyleColorCheckMark) // checkmark-color
StyleColorSliderGrab = StyleColorID(imgui.StyleColorSliderGrab) // slider-grab-color
StyleColorSliderGrabActive = StyleColorID(imgui.StyleColorSliderGrabActive) // slider-grab-active-color
StyleColorButton = StyleColorID(imgui.StyleColorButton) // button-color
StyleColorButtonHovered = StyleColorID(imgui.StyleColorButtonHovered) // button-hovered-color
StyleColorButtonActive = StyleColorID(imgui.StyleColorButtonActive) // button-active-color
StyleColorHeader = StyleColorID(imgui.StyleColorHeader) // header-color
StyleColorHeaderHovered = StyleColorID(imgui.StyleColorHeaderHovered) // header-hovered-color
StyleColorHeaderActive = StyleColorID(imgui.StyleColorHeaderActive) // header-active-color
StyleColorSeparator = StyleColorID(imgui.StyleColorSeparator) // separator-color
StyleColorSeparatorHovered = StyleColorID(imgui.StyleColorSeparatorHovered) // separator-hovered-color
StyleColorSeparatorActive = StyleColorID(imgui.StyleColorSeparatorActive) // separator-active-color
StyleColorResizeGrip = StyleColorID(imgui.StyleColorResizeGrip) // resize-grip-color
StyleColorResizeGripHovered = StyleColorID(imgui.StyleColorResizeGripHovered) // resize-grip-hovered-color
StyleColorResizeGripActive = StyleColorID(imgui.StyleColorResizeGripActive) // resize-grip-active-color
StyleColorTab = StyleColorID(imgui.StyleColorTab) // tab-color
StyleColorTabHovered = StyleColorID(imgui.StyleColorTabHovered) // tab-hovered-color
StyleColorTabActive = StyleColorID(imgui.StyleColorTabActive) // tab-active-color
StyleColorTabUnfocused = StyleColorID(imgui.StyleColorTabUnfocused) // tab-unfocused-color
StyleColorTabUnfocusedActive = StyleColorID(imgui.StyleColorTabUnfocusedActive) // tab-unfocused-active-color
StyleColorPlotLines = StyleColorID(imgui.StyleColorPlotLines) // plot-lines-color
StyleColorPlotLinesHovered = StyleColorID(imgui.StyleColorPlotLinesHovered) // plot-lines-hovered-color
StyleColorProgressBarActive = StyleColorPlotLinesHovered // progress-bar-active-color
StyleColorPlotHistogram = StyleColorID(imgui.StyleColorPlotHistogram) // plot-histogram-color
StyleColorPlotHistogramHovered = StyleColorID(imgui.StyleColorPlotHistogramHovered) // plot-histogram-hovered-color
StyleColorTableHeaderBg = StyleColorID(imgui.StyleColorTableHeaderBg) // table-header-background-color
StyleColorTableBorderStrong = StyleColorID(imgui.StyleColorTableBorderStrong) // table-border-strong-color
StyleColorTableBorderLight = StyleColorID(imgui.StyleColorTableBorderLight) // table-border-light-color
StyleColorTableRowBg = StyleColorID(imgui.StyleColorTableRowBg) // table-row-background-color
StyleColorTableRowBgAlt = StyleColorID(imgui.StyleColorTableRowBgAlt) // table-row-alternate-background-color
StyleColorTextSelectedBg = StyleColorID(imgui.StyleColorTextSelectedBg) // text-selected-background-color
StyleColorDragDropTarget = StyleColorID(imgui.StyleColorDragDropTarget) // drag-drop-target-color
StyleColorNavHighlight = StyleColorID(imgui.StyleColorNavHighlight) // navigation-highlight-color
StyleColorNavWindowingHighlight = StyleColorID(imgui.StyleColorNavWindowingHighlight) // windowing-highlight-color
StyleColorNavWindowingDimBg = StyleColorID(imgui.StyleColorNavWindowingDimBg) // windowing-dim-background-color
StyleColorModalWindowDimBg = StyleColorID(imgui.StyleColorModalWindowDimBg) // modal-window-dim-background-color
)
// StyleVarID identifies a style variable in the UI style.
type StyleVarID imgui.StyleVarID
// Style IDs.
// comments at same line is a CSS name.
const (
// StyleVarAlpha is a float.
StyleVarAlpha = StyleVarID(imgui.StyleVarAlpha) // alpha
// StyleVarDisabledAlpha is a float.
StyleVarDisabledAlpha = StyleVarID(imgui.StyleVarDisabledAlpha) // disabled-alpha
// StyleVarWindowPadding is a Vec2.
StyleVarWindowPadding = StyleVarID(imgui.StyleVarWindowPadding) // window-padding
// StyleVarWindowRounding is a float.
StyleVarWindowRounding = StyleVarID(imgui.StyleVarWindowRounding) // window-rounding
// StyleVarWindowBorderSize is a float.
StyleVarWindowBorderSize = StyleVarID(imgui.StyleVarWindowBorderSize) // window-border-size
// StyleVarWindowMinSize is a Vec2.
StyleVarWindowMinSize = StyleVarID(imgui.StyleVarWindowMinSize) // window-min-size
// StyleVarWindowTitleAlign is a Vec2.
StyleVarWindowTitleAlign = StyleVarID(imgui.StyleVarWindowTitleAlign) // window-title-align
// StyleVarChildRounding is a float.
StyleVarChildRounding = StyleVarID(imgui.StyleVarChildRounding) // child-rounding
// StyleVarChildBorderSize is a float.
StyleVarChildBorderSize = StyleVarID(imgui.StyleVarChildBorderSize) // child-border-size
// StyleVarPopupRounding is a float.
StyleVarPopupRounding = StyleVarID(imgui.StyleVarPopupRounding) // popup-rounding
// StyleVarPopupBorderSize is a float.
StyleVarPopupBorderSize = StyleVarID(imgui.StyleVarPopupBorderSize) // popup-border-size
// StyleVarFramePadding is a Vec2.
StyleVarFramePadding = StyleVarID(imgui.StyleVarFramePadding) // frame-padding
// StyleVarFrameRounding is a float.
StyleVarFrameRounding = StyleVarID(imgui.StyleVarFrameRounding) // frame-rounding
// StyleVarFrameBorderSize is a float.
StyleVarFrameBorderSize = StyleVarID(imgui.StyleVarFrameBorderSize) // frame-border-size
// StyleVarItemSpacing is a Vec2.
StyleVarItemSpacing = StyleVarID(imgui.StyleVarItemSpacing) // item-spacing
// StyleVarItemInnerSpacing is a Vec2.
StyleVarItemInnerSpacing = StyleVarID(imgui.StyleVarItemInnerSpacing) // item-inner-spacing
// StyleVarIndentSpacing is a float.
StyleVarIndentSpacing = StyleVarID(imgui.StyleVarIndentSpacing) // indent-spacing
// StyleVarScrollbarSize is a float.
StyleVarScrollbarSize = StyleVarID(imgui.StyleVarScrollbarSize) // scrollbar-size
// StyleVarScrollbarRounding is a float.
StyleVarScrollbarRounding = StyleVarID(imgui.StyleVarScrollbarRounding) // scrollbar-rounding
// StyleVarGrabMinSize is a float.
StyleVarGrabMinSize = StyleVarID(imgui.StyleVarGrabMinSize) // grab-min-size
// StyleVarGrabRounding is a float.
StyleVarGrabRounding = StyleVarID(imgui.StyleVarGrabRounding) // grab-rounding
// StyleVarTabRounding is a float.
StyleVarTabRounding = StyleVarID(imgui.StyleVarTabRounding) // tab-rounding
// StyleVarButtonTextAlign is a Vec2.
StyleVarButtonTextAlign = StyleVarID(imgui.StyleVarButtonTextAlign) // button-text-align
// StyleVarSelectableTextAlign is a Vec2.
StyleVarSelectableTextAlign = StyleVarID(imgui.StyleVarSelectableTextAlign) // selectable-text-align
)
// IsVec2 returns true if the style var id should be processed as imgui.Vec2
// if not, it is interpreted as float32.
func (i StyleVarID) IsVec2() bool {
lookup := map[StyleVarID]bool{
// StyleVarWindowPadding is a Vec2.
StyleVarWindowPadding: true,
StyleVarWindowMinSize: true,
StyleVarWindowTitleAlign: true,
StyleVarFramePadding: true,
StyleVarItemSpacing: true,
// StyleVarItemInnerSpacing is a Vec2.
StyleVarItemInnerSpacing: true,
StyleVarButtonTextAlign: true,
StyleVarSelectableTextAlign: true,
}
result, ok := lookup[i]
return result && ok
}