Overview
ImGuiStyle contains all the style configuration for Dear ImGui, including colors, sizes, padding, rounding, and spacing. You can modify the style during initialization or between frames.
Getting Style
GetStyle
ImGuiStyle&
Reference to the current style
Style Presets
StyleColorsDark
StyleColorsLight
StyleColorsClassic
ImGuiStyle Structure
Common Style Fields
Padding and Spacing
ImVec2
default:"(8, 8)"
Padding within a window.
ImVec2
default:"(4, 3)"
Padding within a framed rectangle (used by most widgets).
ImVec2
default:"(8, 4)"
Horizontal and vertical spacing between widgets/lines.
ImVec2
default:"(4, 4)"
Horizontal and vertical spacing between within elements of a composed widget.
float
default:"21.0f"
Horizontal indentation when entering a tree node. Generally equals
(FontSize + FramePadding.x*2).Rounding
float
default:"0.0f"
Radius of window corners. Set to 0.0f for rectangular windows.
float
default:"0.0f"
Radius of frame corners.
float
default:"9.0f"
Radius of scrollbar grab corners.
float
default:"0.0f"
Radius of grab corners for sliders.
float
default:"4.0f"
Radius of upper tab corners.
Border Sizes
float
default:"1.0f"
Thickness of border around windows. Generally set to 0.0f or 1.0f.
float
default:"0.0f"
Thickness of border around frames. Generally set to 0.0f or 1.0f.
float
default:"1.0f"
Thickness of border around popups/tooltips.
Anti-Aliasing
bool
default:"true"
Enable anti-aliased lines/borders. Disable if you are really tight on CPU/GPU.
bool
default:"true"
Enable anti-aliased lines/borders using textures where possible. Requires backend to render with bilinear filtering.
bool
default:"true"
Enable anti-aliased edges around filled shapes (rounded rectangles, circles).
Scaling
ScaleAllSizes
float
Scale multiplier
For DPI scaling, also consider adjusting font size.
Style Editor
ShowStyleEditor
ImGuiStyle*
default:"NULL"
Reference style for comparison
ShowStyleSelector
const char*
Label for the selector
bool
True if style was changed
Temporary Style Changes
See Colors forPushStyleColor()/PopStyleColor() and style variable functions.
Common Style Customizations
Flat Style
Rounded Style
Compact Style
Spacious Style
See Also
- Colors - Color configuration and style colors
- Fonts - Font configuration
- ImGuiStyle - Complete style structure reference