Exposed PushMultiItemsWidths() to imgui_internal.h

This commit is contained in:
omar 2017-09-25 22:45:10 +02:00
parent 24f21bd4d4
commit 69d0d33451
2 changed files with 4 additions and 4 deletions

View File

@ -592,7 +592,6 @@
static void LogRenderedText(const ImVec2& ref_pos, const char* text, const char* text_end = NULL);
static void PushMultiItemsWidths(int components, float w_full = 0.0f);
static float GetDraggedColumnOffset(int column_index);
static bool IsKeyPressedMap(ImGuiKey key, bool repeat = true);
@ -4676,12 +4675,12 @@ void ImGui::PushItemWidth(float item_width)
window->DC.ItemWidthStack.push_back(window->DC.ItemWidth);
}
static void PushMultiItemsWidths(int components, float w_full)
void ImGui::PushMultiItemsWidths(int components, float w_full)
{
ImGuiWindow* window = ImGui::GetCurrentWindow();
ImGuiWindow* window = GetCurrentWindow();
const ImGuiStyle& style = GImGui->Style;
if (w_full <= 0.0f)
w_full = ImGui::CalcItemWidth();
w_full = CalcItemWidth();
const float w_item_one = ImMax(1.0f, (float)(int)((w_full - (style.ItemInnerSpacing.x) * (components-1)) / (float)components));
const float w_item_last = ImMax(1.0f, (float)(int)(w_full - (w_item_one + style.ItemInnerSpacing.x) * (components-1)));
window->DC.ItemWidthStack.push_back(w_item_last);

View File

@ -772,6 +772,7 @@ namespace ImGui
IMGUI_API void FocusableItemUnregister(ImGuiWindow* window);
IMGUI_API ImVec2 CalcItemSize(ImVec2 size, float default_x, float default_y);
IMGUI_API float CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x);
IMGUI_API void PushMultiItemsWidths(int components, float width_full = 0.0f);
IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled);
IMGUI_API void PopItemFlag();