|
|
@@ -153,6 +153,14 @@
|
|
|
Here is a change-log of API breaking changes, if you are using one of the functions listed, expect to have to fix some code.
|
|
|
Also read releases logs https://github.com/ocornut/imgui/releases for more details.
|
|
|
|
|
|
+ - 2016/05/12 (1.49) - title bar (using TitleBg/TitleBgActive colors) isn't rendered over a window background (WindowBg color) anymore.
|
|
|
+ If your TitleBg/TitleBgActive alpha was 1.0f or you are using the default theme it will not affect you. However if your TitleBg/TitleBgActive alpha was <1.0f you need to tweak your custom theme to readjust for the fact that we don't draw a WindowBg background behind the title bar.
|
|
|
+ This helper function will convert an old TitleBg/TitleBgActive color into a new one with the same visual output, given that color and the WindowBg color.
|
|
|
+ ImVec4 ConvertTitleBgCol(const ImVec4& win_bg_col, const ImVec4& title_bg_col)
|
|
|
+ {
|
|
|
+ float new_a = 1.0f - ((1.0f - win_bg_col.w) * (1.0f - title_bg_col.w)), k = title_bg_col.w / new_a;
|
|
|
+ return ImVec4((win_bg_col.x * win_bg_col.w + title_bg_col.x) * k, (win_bg_col.y * win_bg_col.w + title_bg_col.y) * k, (win_bg_col.z * win_bg_col.w + title_bg_col.z) * k, new_a);
|
|
|
+ }
|
|
|
- 2016/05/07 (1.49) - removed confusing set of GetInternalState(), GetInternalStateSize(), SetInternalState() functions. Now using CreateContext(), DestroyContext(), GetCurrentContext(), SetCurrentContext().
|
|
|
- 2016/05/02 (1.49) - renamed SetNextTreeNodeOpened() to SetNextTreeNodeOpen(), no redirection.
|
|
|
- 2016/05/01 (1.49) - obsoleted old signature of CollapsingHeader(const char* label, const char* str_id = NULL, bool display_frame = true, bool default_open = false) as extra parameters were badly designed and rarely used. You can replace the "default_open = true" flag in new API with CollapsingHeader(label, ImGuiTreeNodeFlags_DefaultOpen).
|
|
|
@@ -556,6 +564,9 @@
|
|
|
- style: WindowPadding needs to be EVEN needs the 0.5 multiplier probably have a subtle effect on clip rectangle
|
|
|
- text: simple markup language for color change?
|
|
|
- font: dynamic font atlas to avoid baking huge ranges into bitmap and make scaling easier.
|
|
|
+ - font: small opt: for monospace font (like the defalt one) we can trim IndexXAdvance as long as trailing value is == FallbackXAdvance
|
|
|
+ - font: add support for kerning, probably optional. perhaps default to (32..128)^2 matrix ~ 36KB then hash fallback.
|
|
|
+ - font: add a simpler CalcTextSizeA() api? current one ok but not welcome if user needs to call it directly (without going through ImGui::CalcTextSize)
|
|
|
- font: fix AddRemapChar() to work before font has been built.
|
|
|
- log: LogButtons() options for specifying depth and/or hiding depth slider
|
|
|
- log: have more control over the log scope (e.g. stop logging when leaving current tree node scope)
|
|
|
@@ -747,9 +758,9 @@ ImGuiStyle::ImGuiStyle()
|
|
|
Colors[ImGuiCol_FrameBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.30f); // Background of checkbox, radio button, plot, slider, text input
|
|
|
Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.90f, 0.80f, 0.80f, 0.40f);
|
|
|
Colors[ImGuiCol_FrameBgActive] = ImVec4(0.90f, 0.65f, 0.65f, 0.45f);
|
|
|
- Colors[ImGuiCol_TitleBg] = ImVec4(0.50f, 0.50f, 1.00f, 0.45f);
|
|
|
+ Colors[ImGuiCol_TitleBg] = ImVec4(0.27f, 0.27f, 0.54f, 0.83f);
|
|
|
Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.40f, 0.40f, 0.80f, 0.20f);
|
|
|
- Colors[ImGuiCol_TitleBgActive] = ImVec4(0.50f, 0.50f, 1.00f, 0.55f);
|
|
|
+ Colors[ImGuiCol_TitleBgActive] = ImVec4(0.32f, 0.32f, 0.63f, 0.87f);
|
|
|
Colors[ImGuiCol_MenuBarBg] = ImVec4(0.40f, 0.40f, 0.55f, 0.80f);
|
|
|
Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.20f, 0.25f, 0.30f, 0.60f);
|
|
|
Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.40f, 0.40f, 0.80f, 0.30f);
|
|
|
@@ -4057,7 +4068,7 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us
|
|
|
bg_color.w = bg_alpha;
|
|
|
bg_color.w *= style.Alpha;
|
|
|
if (bg_color.w > 0.0f)
|
|
|
- window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, ColorConvertFloat4ToU32(bg_color), window_rounding);
|
|
|
+ window->DrawList->AddRectFilled(window->Pos+ImVec2(0,window->TitleBarHeight()), window->Pos+window->Size, ColorConvertFloat4ToU32(bg_color), window_rounding, (flags & ImGuiWindowFlags_NoTitleBar) ? 15 : 4|8);
|
|
|
|
|
|
// Title bar
|
|
|
if (!(flags & ImGuiWindowFlags_NoTitleBar))
|
|
|
@@ -5335,7 +5346,12 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
|
|
SetHoveredID(id);
|
|
|
if (!(flags & ImGuiButtonFlags_NoKeyModifiers) || (!g.IO.KeyCtrl && !g.IO.KeyShift && !g.IO.KeyAlt))
|
|
|
{
|
|
|
- if ((flags & ImGuiButtonFlags_PressedOnClickRelease) && g.IO.MouseClicked[0]) // Most common type
|
|
|
+ // | CLICKING | HOLDING with ImGuiButtonFlags_Repeat
|
|
|
+ // PressedOnClickRelease | <on release>* | <on repeat> <on repeat> .. (NOT on release) <-- MOST COMMON! (*) only if both click/release were over bounds
|
|
|
+ // PressedOnClick | <on click> | <on click> <on repeat> <on repeat> ..
|
|
|
+ // PressedOnRelease | <on release> | <on repeat> <on repeat> .. (NOT on release)
|
|
|
+ // PressedOnDoubleClick | <on dclick> | <on dclick> <on repeat> <on repeat> ..
|
|
|
+ if ((flags & ImGuiButtonFlags_PressedOnClickRelease) && g.IO.MouseClicked[0])
|
|
|
{
|
|
|
SetActiveID(id, window); // Hold on ID
|
|
|
FocusWindow(window);
|
|
|
@@ -5348,10 +5364,14 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
|
|
}
|
|
|
if ((flags & ImGuiButtonFlags_PressedOnRelease) && g.IO.MouseReleased[0])
|
|
|
{
|
|
|
- pressed = true;
|
|
|
+ if (!((flags & ImGuiButtonFlags_Repeat) && g.IO.MouseDownDurationPrev[0] >= g.IO.KeyRepeatDelay)) // Repeat mode trumps <on release>
|
|
|
+ pressed = true;
|
|
|
SetActiveID(0);
|
|
|
}
|
|
|
- if ((flags & ImGuiButtonFlags_Repeat) && g.ActiveId == id && ImGui::IsMouseClicked(0, true))
|
|
|
+
|
|
|
+ // 'Repeat' mode acts when held regardless of _PressedOn flags (see table above).
|
|
|
+ // Relies on repeat logic of IsMouseClicked() but we may as well do it ourselves if we end up exposing finer RepeatDelay/RepeatRate settings.
|
|
|
+ if ((flags & ImGuiButtonFlags_Repeat) && g.ActiveId == id && g.IO.MouseDownDuration[0] > 0.0f && ImGui::IsMouseClicked(0, true))
|
|
|
pressed = true;
|
|
|
}
|
|
|
}
|
|
|
@@ -5366,7 +5386,8 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
|
|
|
else
|
|
|
{
|
|
|
if (hovered && (flags & ImGuiButtonFlags_PressedOnClickRelease))
|
|
|
- pressed = true;
|
|
|
+ if (!((flags & ImGuiButtonFlags_Repeat) && g.IO.MouseDownDurationPrev[0] >= g.IO.KeyRepeatDelay)) // Repeat mode trumps <on release>
|
|
|
+ pressed = true;
|
|
|
SetActiveID(0);
|
|
|
}
|
|
|
}
|
|
|
@@ -9181,7 +9202,7 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
|
|
|
continue;
|
|
|
|
|
|
bool hovered, held;
|
|
|
- ButtonBehavior(column_rect, column_id, &hovered, &held, true);
|
|
|
+ ButtonBehavior(column_rect, column_id, &hovered, &held);
|
|
|
if (hovered || held)
|
|
|
g.MouseCursor = ImGuiMouseCursor_ResizeEW;
|
|
|
|