WindowRounding=9.0f;// Radius of window corners rounding. Set to 0.0f to have rectangular windows
WindowTitleAlign=ImGuiAlign_Left;// Alignment for title bar text
WindowTitleAlign=ImVec2(0.0f,0.5f);// Alignment for title bar text
ChildWindowRounding=0.0f;// Radius of child window corners rounding. Set to 0.0f to have rectangular child windows
FramePadding=ImVec2(4,3);// Padding within a framed rectangle (used by most widgets)
FrameRounding=0.0f;// Radius of frame corners rounding. Set to 0.0f to have rectangular frames (used by most widgets).
@ -745,6 +745,7 @@ ImGuiStyle::ImGuiStyle()
ScrollbarRounding=9.0f;// Radius of grab corners rounding for scrollbar
GrabMinSize=10.0f;// Minimum width/height of a grab box for slider/scrollbar
GrabRounding=0.0f;// Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
ButtonTextAlign=ImVec2(0.5f,0.5f);// Alignment of button text when button is larger than text.
DisplayWindowPadding=ImVec2(22,22);// Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows.
DisplaySafeAreaPadding=ImVec2(4,4);// 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.
AntiAliasedLines=true;// Enable anti-aliasing on lines/borders. Disable if you are really short on CPU/GPU.
ImVec2clip_max=ImVec2(window->Pos.x+window->Size.x-(p_open?title_bar_rect.GetHeight()-3:style.FramePadding.x),text_max.y);// Match the size of CloseWindowButton()
clip_rect.Max=ImVec2(window->Pos.x+window->Size.x-(p_open?title_bar_rect.GetHeight()-3:style.FramePadding.x),text_max.y);// Match the size of CloseWindowButton()
if((flags&ImGuiButtonFlags_AlignTextBaseLine)&&style.FramePadding.y<window->DC.CurrentLineTextBaseOffset)// Try to vertically align buttons that are smaller/have no padding so that text baseline matches (bit hacky, since it shouldn't be a flag)
ImVec2size=CalcItemSize(size_arg,CalcItemWidth(),(is_multiline?GetTextLineHeight()*8.0f:label_size.y)+style.FramePadding.y*2.0f);// Arbitrary default of 8 lines high for multi-line
tb.y=ta.y+ImMax((tb.y-extra)-ta.y,-100.0f);// triangle is maximum 200 high to limit the slope and the bias toward large sub-menus // FIXME: Multiply by fb_scale?
group_bb.Max.y-=style.ItemSpacing.y;// Cancel out last vertical spacing because we are adding one ourselves.
group_bb.Max.y-=g.Style.ItemSpacing.y;// Cancel out last vertical spacing because we are adding one ourselves.
group_bb.Max=ImMax(group_bb.Min,group_bb.Max);
window->DC.CursorPos=group_data.BackupCursorPos;
@ -9362,9 +9372,17 @@ void ImGui::EndGroup()
ItemAdd(group_bb,NULL);
}
// If the current ActiveId was declared within the boundary of our group, we copy it to LastItemId so IsItemActive() will function on the entire group.
// It would be be neater if we replaced window.DC.LastItemId by e.g. 'bool LastItemIsActive', but if you search for LastItemId you'll notice it is only used in that context.
// Enumeration for ColorEdit3() / ColorEdit4() / ColorPicker3() / ColorPicker4()
@ -703,7 +694,7 @@ struct ImGuiStyle
ImVec2WindowPadding;// Padding within a window
ImVec2WindowMinSize;// Minimum window size
floatWindowRounding;// Radius of window corners rounding. Set to 0.0f to have rectangular windows
ImGuiAlignWindowTitleAlign;// Alignment for title bar text
ImVec2 WindowTitleAlign;// Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.
floatChildWindowRounding;// Radius of child window corners rounding. Set to 0.0f to have rectangular windows
ImVec2FramePadding;// Padding within a framed rectangle (used by most widgets)
floatFrameRounding;// Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
@ -714,8 +705,9 @@ struct ImGuiStyle
floatColumnsMinSpacing;// Minimum horizontal spacing between two columns
floatScrollbarSize;// Width of the vertical scrollbar, Height of the horizontal scrollbar
floatScrollbarRounding;// Radius of grab corners for scrollbar
floatGrabMinSize;// Minimum width/height of a grab box for slider/scrollbar
floatGrabMinSize;// Minimum width/height of a grab box for slider/scrollbar.
floatGrabRounding;// Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
ImVec2ButtonTextAlign;// Alignment of button text when button is larger than text. Defaults to (0.5f,0.5f) for horizontally+vertically centered.
ImVec2DisplayWindowPadding;// Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows.
ImVec2DisplaySafeAreaPadding;// 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.
boolAntiAliasedLines;// Enable anti-aliasing on lines/borders. Disable if you are really tight on CPU/GPU.
#define IM_COL32_BLACK_TRANS (0x00000000) // Transparent black
// Draw callbacks for advanced uses.
// NB- You most likely do NOT need to use draw callbacks just to create your own widget or customized UI rendering (you can poke into the draw list for that)
// Draw callback may be useful for example, A) Change your GPU render state, B) render a complex 3D scene inside a UI element (without an intermediate texture/render target), etc.
#pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int'
#pragma clang diagnostic ignored "-Wformat-security" // warning : warning: format string is not a string literal
#pragma clang diagnostic ignored "-Wexit-time-destructors" // warning : declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals.
#pragma clang diagnostic ignored "-Wreserved-id-macro" // warning : macro name is a reserved identifier //
#if __has_warning("-Wreserved-id-macro")
#pragma clang diagnostic ignored "-Wreserved-id-macro" // warning : macro name is a reserved identifier //
#endif
#elif defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
#pragma GCC diagnostic ignored "-Wformat-security" // warning : format string is not a string literal (potentially insecure)
ImGui::SliderFloat2("ButtonTextAlign",(float*)&style.ButtonTextAlign,0.0f,1.0f,"%.2f");ImGui::SameLine();ShowHelpMarker("Alignment applies when a button is larger than its text content.");
ImGui::DragFloat("font scale",&font->Scale,0.005f,0.3f,2.0f,"%.1f");// scale only this font
ImGui::DragFloat("Font scale",&font->Scale,0.005f,0.3f,2.0f,"%.1f");// Scale only this font
ImGui::SameLine();ShowHelpMarker("Note than the default embedded font is NOT meant to be scaled.\n\nFont are currently rendered into bitmaps at a given size at the time of building the atlas. You may oversample them to get some flexibility with scaling. You can also render at multiple sizes and select which one to use at runtime.\n\n(Glimmer of hope: the atlas system should hopefully be rewritten in the future to make scaling more natural and automatic.)");
// Display all glyphs of the fonts in separate pages of 256 characters
constImFont::Glyph*glyph_fallback=font->FallbackGlyph;// Forcefully/dodgily make FindGlyph() return NULL on fallback, which isn't the default behavior.
font->RenderChar(draw_list,cell_size.x,cell_p1,ImGui::GetColorU32(ImGuiCol_Text),(ImWchar)(base+n));// We use ImFont::RenderChar as a shortcut because we don't have UTF-8 conversion functions available to generate a string.
draw_list->PushClipRect(canvas_pos,ImVec2(canvas_pos.x+canvas_size.x,canvas_pos.y+canvas_size.y));// clip lines within the canvas (if we resize it, etc.)
#pragma clang diagnostic ignored "-Wfloat-equal" // warning : comparing floating point with == or != is unsafe // storing and comparing against same constants ok.
#pragma clang diagnostic ignored "-Wglobal-constructors" // warning : declaration requires a global destructor // similar to above, not sure what the exact difference it.
// NB: All position are in absolute pixels coordinates (not window coordinates)
// FIXME: All those functions are a mess and needs to be refactored into something decent. Avoid use outside of imgui.cpp!
// FIXME: All those functions are a mess and needs to be refactored into something decent. AVOID USING OUTSIDE OF IMGUI.CPP! NOT FOR PUBLIC CONSUMPTION.
// We need: a sort of symbol library, preferably baked into font atlas when possible + decent text rendering helpers.