mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-14 17:07:01 +00:00
Tabs to spaces
This commit is contained in:
parent
466f01b313
commit
ad3c9f620d
28
imgui.cpp
28
imgui.cpp
@ -2836,9 +2836,9 @@ ImVec2 ImGui::GetMousePos()
|
||||
ImVec2 ImGui::GetMousePosOnOpeningCurrentPopup()
|
||||
{
|
||||
ImGuiState& g = *GImGui;
|
||||
if (g.CurrentPopupStack.Size > 0)
|
||||
return g.OpenedPopupStack[g.CurrentPopupStack.Size-1].MousePosOnOpen;
|
||||
return g.IO.MousePos;
|
||||
if (g.CurrentPopupStack.Size > 0)
|
||||
return g.OpenedPopupStack[g.CurrentPopupStack.Size-1].MousePosOnOpen;
|
||||
return g.IO.MousePos;
|
||||
}
|
||||
|
||||
ImVec2 ImGui::GetMouseDragDelta(int button, float lock_threshold)
|
||||
@ -4409,7 +4409,7 @@ static void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiSetCond
|
||||
// Set
|
||||
if (size.x > 0.0f)
|
||||
{
|
||||
window->AutoFitFramesX = 0;
|
||||
window->AutoFitFramesX = 0;
|
||||
window->SizeFull.x = size.x;
|
||||
}
|
||||
else
|
||||
@ -4419,7 +4419,7 @@ static void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiSetCond
|
||||
}
|
||||
if (size.y > 0.0f)
|
||||
{
|
||||
window->AutoFitFramesY = 0;
|
||||
window->AutoFitFramesY = 0;
|
||||
window->SizeFull.y = size.y;
|
||||
}
|
||||
else
|
||||
@ -7636,7 +7636,7 @@ bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(voi
|
||||
|
||||
const ImRect value_bb(frame_bb.Min, frame_bb.Max - ImVec2(arrow_size, 0.0f));
|
||||
RenderFrame(frame_bb.Min, frame_bb.Max, window->Color(ImGuiCol_FrameBg), true, style.FrameRounding);
|
||||
RenderFrame(ImVec2(frame_bb.Max.x-arrow_size, frame_bb.Min.y), frame_bb.Max, window->Color(hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button), true, style.FrameRounding); // FIXME-ROUNDING
|
||||
RenderFrame(ImVec2(frame_bb.Max.x-arrow_size, frame_bb.Min.y), frame_bb.Max, window->Color(hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button), true, style.FrameRounding); // FIXME-ROUNDING
|
||||
RenderCollapseTriangle(ImVec2(frame_bb.Max.x-arrow_size, frame_bb.Min.y) + style.FramePadding, true);
|
||||
|
||||
if (*current_item >= 0 && *current_item < items_count)
|
||||
@ -7662,7 +7662,7 @@ bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(voi
|
||||
}
|
||||
else
|
||||
{
|
||||
FocusWindow(window);
|
||||
FocusWindow(window);
|
||||
ImGui::OpenPopup(label);
|
||||
menu_toggled = true;
|
||||
}
|
||||
@ -8931,13 +8931,13 @@ void ImGui::ShowMetricsWindow(bool* opened)
|
||||
}
|
||||
ImGui::TreePop();
|
||||
}
|
||||
if (ImGui::TreeNode("Basic state"))
|
||||
{
|
||||
ImGui::Text("FocusedWindow: '%s'", g.FocusedWindow ? g.FocusedWindow->Name : "NULL");
|
||||
ImGui::Text("HoveredWindow: '%s'", g.HoveredWindow ? g.HoveredWindow->Name : "NULL");
|
||||
ImGui::Text("HoveredRootWindow: '%s'", g.HoveredRootWindow ? g.HoveredRootWindow->Name : "NULL");
|
||||
ImGui::Text("HoveredID: 0x%08X/0x%08X", g.HoveredId, g.HoveredIdPreviousFrame); // Data is "in-flight" so depending on when the Metrics window is called we may see current frame information or not
|
||||
ImGui::Text("ActiveID: 0x%08X/0x%08X", g.ActiveId, g.ActiveIdPreviousFrame);
|
||||
if (ImGui::TreeNode("Basic state"))
|
||||
{
|
||||
ImGui::Text("FocusedWindow: '%s'", g.FocusedWindow ? g.FocusedWindow->Name : "NULL");
|
||||
ImGui::Text("HoveredWindow: '%s'", g.HoveredWindow ? g.HoveredWindow->Name : "NULL");
|
||||
ImGui::Text("HoveredRootWindow: '%s'", g.HoveredRootWindow ? g.HoveredRootWindow->Name : "NULL");
|
||||
ImGui::Text("HoveredID: 0x%08X/0x%08X", g.HoveredId, g.HoveredIdPreviousFrame); // Data is "in-flight" so depending on when the Metrics window is called we may see current frame information or not
|
||||
ImGui::Text("ActiveID: 0x%08X/0x%08X", g.ActiveId, g.ActiveIdPreviousFrame);
|
||||
ImGui::TreePop();
|
||||
}
|
||||
g.DisableHideTextAfterDoubleHash--;
|
||||
|
4
imgui.h
4
imgui.h
@ -398,7 +398,7 @@ namespace ImGui
|
||||
IMGUI_API bool IsMouseHoveringRect(const ImVec2& pos_min, const ImVec2& pos_max); // is mouse hovering given bounding rect (in screen space). clipped by current clipping settings. disregarding of consideration of focus/window ordering/blocked by a popup.
|
||||
IMGUI_API bool IsMouseDragging(int button = 0, float lock_threshold = -1.0f); // is mouse dragging. if lock_threshold < -1.0f uses io.MouseDraggingThreshold
|
||||
IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
|
||||
IMGUI_API ImVec2 GetMousePosOnOpeningCurrentPopup(); // retrieve backup of mouse positioning at the time of opening popup we have BeginPopup() into
|
||||
IMGUI_API ImVec2 GetMousePosOnOpeningCurrentPopup(); // retrieve backup of mouse positioning at the time of opening popup we have BeginPopup() into
|
||||
IMGUI_API ImVec2 GetMouseDragDelta(int button = 0, float lock_threshold = -1.0f); // dragging amount since clicking. if lock_threshold < -1.0f uses io.MouseDraggingThreshold
|
||||
IMGUI_API void ResetMouseDragDelta(int button = 0); //
|
||||
IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired cursor type, reset in ImGui::NewFrame(), this updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
|
||||
@ -1065,7 +1065,7 @@ struct ImDrawList
|
||||
ImDrawIdx* _IdxWritePtr; // [Internal] point within IdxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
|
||||
ImVector<ImVec4> _ClipRectStack; // [Internal]
|
||||
ImVector<ImTextureID> _TextureIdStack; // [Internal]
|
||||
ImVector<ImVec2> _Path; // [Internal] current path building
|
||||
ImVector<ImVec2> _Path; // [Internal] current path building
|
||||
int _ChannelCurrent; // [Internal] current channel number (0)
|
||||
ImVector<ImDrawChannel> _Channels; // [Internal] draw channels for columns API
|
||||
|
||||
|
@ -81,7 +81,7 @@ int ImTextCountCharsFromUtf8(const char* in_text, const char* in
|
||||
int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end); // return number of bytes to express string as UTF-8 code-points
|
||||
|
||||
// Helpers: Misc
|
||||
ImU32 ImHash(const void* data, int data_size, ImU32 seed = 0); // Pass data_size==0 for zero-terminated strings
|
||||
ImU32 ImHash(const void* data, int data_size, ImU32 seed = 0); // Pass data_size==0 for zero-terminated strings
|
||||
bool ImLoadFileToMemory(const char* filename, const char* file_open_mode, void** out_file_data, int* out_file_size = NULL, int padding_bytes = 0);
|
||||
bool ImIsPointInTriangle(const ImVec2& p, const ImVec2& a, const ImVec2& b, const ImVec2& c);
|
||||
static inline bool ImCharIsSpace(int c) { return c == ' ' || c == '\t' || c == 0x3000; }
|
||||
@ -305,7 +305,7 @@ struct ImGuiPopupRef
|
||||
ImGuiWindow* Window; // Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup()
|
||||
ImGuiWindow* ParentWindow; // Set on OpenPopup()
|
||||
ImGuiID ParentMenuSet; // Set on OpenPopup()
|
||||
ImVec2 MousePosOnOpen; // Copy of mouse position at the time of opening popup
|
||||
ImVec2 MousePosOnOpen; // Copy of mouse position at the time of opening popup
|
||||
|
||||
ImGuiPopupRef(ImGuiID id, ImGuiWindow* parent_window, ImGuiID parent_menu_set, const ImVec2& mouse_pos) { PopupID = id; Window = NULL; ParentWindow = parent_window; ParentMenuSet = parent_menu_set; MousePosOnOpen = mouse_pos; }
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user