User Tools

Site Tools


addons:functions:gui:imgui.style

ImGui Style Table

The ImGui Style table the current visual style of ImGui and the various properties that can alter it.


Accessing ImGui Style Table

Within an addon, you can access the ImGui Style table via 'imgui.style'.

local style = imgui.style;


ImGui Style Table Notes

Please note! The imgui.style table differs from the main imgui functions! Please be sure to read the following notes carefully!!

The imgui.style table differs from the functions found within the 'imgui' table. The style table is implemented in a different manner and can make use of certain types such as ImVec2, ImVec4, etc. Because of this, things are used a little differently. But it should be straight forward enough.

Here are some examples of how you can make use of the imgui.style table properties:

-- Obtain the style table..
local s = imgui.style;

-- Set the rounding properties to 0..
s.GrabRounding = 0;
s.FrameRounding = 0;
s.ScrollbarRounding = 0;
s.WindowRounding = 0;

-- Set a color to black..
local colors = imgui.style.Colors;
colors[ImGuiCol_WindowBg] = ImVec4(0.0, 0.0, 0.0, 1.0);
imgui.style.Colors = colors;

Any property that is within an array must be done in the above manner. You cannot directly index these arrays and set their values.
You must pull the array, edit it, then reset the full array to make changes.


ImGui IO Table Properties

  • float Alpha - Global alpha amount that applies to the entire ImGui rendering.
  • ImVec2 WindowPadding - The default window padding applied to windows.
  • ImVec2 WindowMinSize - The minimum window size.
  • float WindowRounding - The amount of rounding to apply to the window corners.
  • ImVec2 WindowTitleAlign - The alignment of the title of a window.
  • float ChildWindowRounding - Child window corner rounding.
  • ImVec2 FramePadding - Padding applied to framed rectangles.
  • float FrameRounding - Rounding applied to framed rectangles.
  • ImVec2 ItemSpacing - The amount of spacing between widgets and lines.
  • ImVec2 ItemInnerSpacing - The amount of spacing within elements of a composed widget. (ex. label inside of a slider.)
  • ImVec2 TouchExtraPadding - Padding added to controls to enhance touch usage. (Not used.)
  • float IndentSpacing - Default horizontal indentation amount.
  • float ColumnsMinSpacing - Minimum horizontal spacing between two columns.
  • float ScrollbarSize - Default size of a scroll bar. (Width if vertical, Height if horizontal.)
  • float ScrollbarRounding - The amount of rounding to apply to scrollbar corners.
  • float GrabMinSize - Minimum width/height of a grab box for sliders / scrollbars.
  • float GrabRounding - The amount of rounding to apply to grips.
  • ImVec2 DisplayWindowPadding - Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows.
  • ImVec2 DisplaySafeAreaPadding - If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows.
  • bool AntiAliasedLines - Enable anti-aliasing on lines / borders.
  • bool AntiAliasedShapes - Enable anti-aliasing on filled shapes.
  • float CurveTessellationTol - Tessellation tolerance. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
  • ImVec4 Colors[43] - Array of colors used by ImGui to render the theme. (See the list of ImGuiCol_ properties in the imgui.lua library file for more info.)
addons/functions/gui/imgui.style.txt · Last modified: 2017/04/22 00:10 (external edit)