From 886d954e3df5041e0cf96cc0ae6835bd21d7ea06 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 29 Dec 2014 19:56:01 +0000 Subject: [PATCH] GetStyleColorName -> GetStyleColName for consistency with type name. Removed ImGuiStyleVar_ColumnsMinSpacing --- imgui.cpp | 7 +++---- imgui.h | 9 ++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 94f4e864..24c8cd34 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -348,13 +348,13 @@ ImGuiStyle::ImGuiStyle() Alpha = 1.0f; // Global alpha applies to everything in ImGui WindowPadding = ImVec2(8,8); // Padding within a window WindowMinSize = ImVec2(48,48); // Minimum window size + WindowRounding = 10.0f; // Radius of window corners rounding. Set to 0.0f to have rectangular windows FramePadding = ImVec2(5,4); // Padding within a framed rectangle (used by most widgets) ItemSpacing = ImVec2(10,5); // Horizontal and vertical spacing between widgets/lines ItemInnerSpacing = ImVec2(5,5); // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label) TouchExtraPadding = ImVec2(0,0); // Expand bounding box for touch-based system where touch position is not accurate enough (unnecessary for mouse inputs). Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget running. So dont grow this too much! AutoFitPadding = ImVec2(8,8); // Extra space after auto-fit (double-clicking on resize grip) WindowFillAlphaDefault = 0.70f; // Default alpha of window background, if not specified in ImGui::Begin() - WindowRounding = 10.0f; // Radius of window corners rounding. Set to 0.0f to have rectangular windows TreeNodeSpacing = 22.0f; // Horizontal spacing when entering a tree node ColumnsMinSpacing = 6.0f; // Minimum horizontal spacing between two columns ScrollBarWidth = 16.0f; // Width of the vertical scroll bar @@ -2758,7 +2758,6 @@ static float* GetStyleVarFloatAddr(ImGuiStyleVar idx) case ImGuiStyleVar_Alpha: return &g.Style.Alpha; case ImGuiStyleVar_WindowRounding: return &g.Style.WindowRounding; case ImGuiStyleVar_TreeNodeSpacing: return &g.Style.TreeNodeSpacing; - case ImGuiStyleVar_ColumnsMinSpacing: return &g.Style.ColumnsMinSpacing; } return NULL; } @@ -2819,7 +2818,7 @@ void ImGui::PopStyleVar(int count) } } -const char* ImGui::GetStyleColorName(ImGuiCol idx) +const char* ImGui::GetStyleColName(ImGuiCol idx) { // Create switch-case from enum with regexp: ImGuiCol_{.*}, --> case ImGuiCol_\1: return "\1"; switch (idx) @@ -6719,7 +6718,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) ImGui::ColorEditMode(edit_mode); for (int i = 0; i < ImGuiCol_COUNT; i++) { - const char* name = GetStyleColorName(i); + const char* name = ImGui::GetStyleColName(i); if (!filter.PassFilter(name)) continue; ImGui::PushID(i); diff --git a/imgui.h b/imgui.h index 14a0e4c0..4499f9f2 100644 --- a/imgui.h +++ b/imgui.h @@ -280,11 +280,11 @@ namespace ImGui IMGUI_API void Color(const char* prefix, const ImVec4& v); IMGUI_API void Color(const char* prefix, unsigned int v); - // Logging: All text output can be redirected to tty/file/clipboard. Tree nodes are automatically opened. + // Logging: All text output from your interface are redirected to tty/file/clipboard. Tree nodes are automatically opened. IMGUI_API void LogToTTY(int max_depth = -1); // start logging to tty IMGUI_API void LogToFile(int max_depth = -1, const char* filename = NULL); // start logging to file IMGUI_API void LogToClipboard(int max_depth = -1); // start logging to OS clipboard - IMGUI_API void LogFinish(); // stop logging (close file, etc.) + IMGUI_API void LogFinish(); // stop logging (close file, etc.) IMGUI_API void LogButtons(); // helper to display buttons for logging to tty/file/clipboard // Utilities @@ -303,7 +303,7 @@ namespace ImGui IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls IMGUI_API float GetTime(); IMGUI_API int GetFrameCount(); - IMGUI_API const char* GetStyleColorName(ImGuiCol idx); + IMGUI_API const char* GetStyleColName(ImGuiCol idx); IMGUI_API void GetDefaultFontData(const void** fnt_data, unsigned int* fnt_size, const void** png_data, unsigned int* png_size); IMGUI_API ImVec2 CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f); @@ -419,7 +419,6 @@ enum ImGuiStyleVar_ ImGuiStyleVar_ItemSpacing, // ImVec2 ImGuiStyleVar_ItemInnerSpacing, // ImVec2 ImGuiStyleVar_TreeNodeSpacing, // float - ImGuiStyleVar_ColumnsMinSpacing // float }; // Enumeration for ColorEditMode() @@ -445,13 +444,13 @@ struct ImGuiStyle float Alpha; // Global alpha applies to everything in ImGui ImVec2 WindowPadding; // Padding within a window ImVec2 WindowMinSize; // Minimum window size + float WindowRounding; // Radius of window corners rounding. Set to 0.0f to have rectangular windows ImVec2 FramePadding; // Padding within a framed rectangle (used by most widgets) ImVec2 ItemSpacing; // Horizontal and vertical spacing between widgets/lines ImVec2 ItemInnerSpacing; // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label) ImVec2 TouchExtraPadding; // Expand bounding box for touch-based system where touch position is not accurate enough (unnecessary for mouse inputs). Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget running. So dont grow this too much! ImVec2 AutoFitPadding; // Extra space after auto-fit (double-clicking on resize grip) float WindowFillAlphaDefault; // Default alpha of window background, if not specified in ImGui::Begin() - float WindowRounding; // Radius of window corners rounding. Set to 0.0f to have rectangular windows float TreeNodeSpacing; // Horizontal spacing when entering a tree node float ColumnsMinSpacing; // Minimum horizontal spacing between two columns float ScrollBarWidth; // Width of the vertical scroll bar