Skip to content

Commit

Permalink
Fixed added tabs instead of whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
dacuster committed Aug 9, 2024
1 parent 65beb2a commit 8e9b3f5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -562,11 +562,11 @@ namespace ImGui
// - The old Combo() api are helpers over BeginCombo()/EndCombo() which are kept available for convenience purpose. This is analogous to how ListBox are created.
IMGUI_API bool BeginCombo(const char* label, const char* preview_value, ImGuiComboFlags flags = 0);
IMGUI_API void EndCombo(); // only call EndCombo() if BeginCombo() returns true!
// MicroStrain start
// MicroStrain start
// TODO: Rework to use ImGuiTextFilter instead of InputText
IMGUI_API bool BeginComboInputText(const char* label, const char* preview_value, char* buffer, size_t buffer_size, bool* buffer_changed = NULL, ImGuiComboFlags combo_flags = 0, ImGuiInputTextFlags input_flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);
IMGUI_API void EndComboInputText();
// MicroStrain end
// MicroStrain end
IMGUI_API bool Combo(const char* label, int* current_item, const char* const items[], int items_count, int popup_max_height_in_items = -1);
IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_max_height_in_items = -1); // Separate items with \0 within a string, end item-list with \0\0. e.g. "One\0Two\0Three\0"
IMGUI_API bool Combo(const char* label, int* current_item, const char* (*getter)(void* user_data, int idx), void* user_data, int items_count, int popup_max_height_in_items = -1);
Expand Down
12 changes: 6 additions & 6 deletions imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1792,10 +1792,10 @@ bool ImGui::BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags
constraint_min.x = w;
if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize) == 0 || g.NextWindowData.SizeVal.y <= 0.0f)
constraint_max.y = CalcMaxPopupHeightFromItemCount(popup_max_height_in_items);
// MicroStrain start
// MicroStrain start
if (flags & ImGuiComboFlags_InputText)
constraint_max.y += bb.GetHeight();
// MicroStrain end
// MicroStrain end
SetNextWindowSizeConstraints(constraint_min, constraint_max);
}

Expand All @@ -1820,14 +1820,14 @@ bool ImGui::BeginComboPopup(ImGuiID popup_id, const ImRect& bb, ImGuiComboFlags
// We don't use BeginPopupEx() solely because we have a custom name string, which we could make an argument to BeginPopupEx()
ImGuiWindowFlags window_flags = ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_Popup | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoMove;
// MicroStrain start
if (flags & ImGuiComboFlags_InputText)
if (flags & ImGuiComboFlags_InputText)
{
PushStyleVar(ImGuiStyleVar_PopupBorderSize, 0.0f); // The child window only needs a border
PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f)); // Remove padding since the child window will replace the full popup
}
else
PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(g.Style.FramePadding.x, g.Style.WindowPadding.y)); // Horizontally align ourselves with the framed text
// MicroStrain end
// MicroStrain end
// PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(g.Style.FramePadding.x, g.Style.WindowPadding.y)); // Horizontally align ourselves with the framed text // MicroStrain (original)
bool ret = Begin(name, NULL, window_flags);
// PopStyleVar(); // MicroStrain (original)
Expand Down Expand Up @@ -6892,14 +6892,14 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
ImGui::PushStyleColor(ImGuiCol_Text, GetColorU32(ImGuiCol_HeaderText));
else if (disabled_item || disabled_global)
ImGui::PushStyleColor(ImGuiCol_Text, GetColorU32(ImGuiCol_TextDisabled));
// MicroStrain end
// MicroStrain end

RenderTextClipped(text_min, text_max, label, NULL, &label_size, style.SelectableTextAlign, &bb);

// MicroStrain start
if (hovered || selected || disabled_item || disabled_global)
ImGui::PopStyleColor();
// MicroStrain end
// MicroStrain end

// Automatically close popups
// if (pressed && (window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiSelectableFlags_DontClosePopups) && !(g.LastItemData.InFlags & ImGuiItemFlags_SelectableDontClosePopup)) // MicroStrain (original)
Expand Down
2 changes: 1 addition & 1 deletion misc/cpp/imgui_stdlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ bool ImGui::InputTextWithHint(const char* label, const char* hint, std::string*
// MicroStrain start
void ImGui::TextUnformatted(std::string_view text)
{
ImGui::TextUnformatted(text.data(), text.data() + text.size());
ImGui::TextUnformatted(text.data(), text.data() + text.size());
}
// MicroStrain end

Expand Down

0 comments on commit 8e9b3f5

Please sign in to comment.