mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-05 21:07:51 +00:00
Merge branch 'master' into docking
# Conflicts: # docs/CHANGELOG.txt # imgui.cpp # imgui.h # imgui_draw.cpp
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.90.8
|
||||
// dear imgui, v1.90.9 WIP
|
||||
// (widgets code)
|
||||
|
||||
/*
|
||||
@@ -7934,7 +7934,9 @@ bool ImGui::BeginTabBar(const char* str_id, ImGuiTabBarFlags flags)
|
||||
tab_bar->ID = id;
|
||||
tab_bar->SeparatorMinX = tab_bar->BarRect.Min.x - IM_TRUNC(window->WindowPadding.x * 0.5f);
|
||||
tab_bar->SeparatorMaxX = tab_bar->BarRect.Max.x + IM_TRUNC(window->WindowPadding.x * 0.5f);
|
||||
return BeginTabBarEx(tab_bar, tab_bar_bb, flags | ImGuiTabBarFlags_IsFocused);
|
||||
//if (g.NavWindow && IsWindowChildOf(g.NavWindow, window, false, false))
|
||||
flags |= ImGuiTabBarFlags_IsFocused;
|
||||
return BeginTabBarEx(tab_bar, tab_bar_bb, flags);
|
||||
}
|
||||
|
||||
bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImGuiTabBarFlags flags)
|
||||
@@ -7989,7 +7991,7 @@ bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImG
|
||||
|
||||
// Draw separator
|
||||
// (it would be misleading to draw this in EndTabBar() suggesting that it may be drawn over tabs, as tab bar are appendable)
|
||||
const ImU32 col = GetColorU32((flags & ImGuiTabBarFlags_IsFocused) ? ImGuiCol_TabActive : ImGuiCol_TabUnfocusedActive);
|
||||
const ImU32 col = GetColorU32((flags & ImGuiTabBarFlags_IsFocused) ? ImGuiCol_TabSelected : ImGuiCol_TabDimmedSelected);
|
||||
if (g.Style.TabBarBorderSize > 0.0f)
|
||||
{
|
||||
const float y = tab_bar->BarRect.Max.y;
|
||||
@@ -8945,8 +8947,16 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
|
||||
|
||||
// Render tab shape
|
||||
ImDrawList* display_draw_list = window->DrawList;
|
||||
const ImU32 tab_col = GetColorU32((held || hovered) ? ImGuiCol_TabHovered : tab_contents_visible ? (tab_bar_focused ? ImGuiCol_TabActive : ImGuiCol_TabUnfocusedActive) : (tab_bar_focused ? ImGuiCol_Tab : ImGuiCol_TabUnfocused));
|
||||
const ImU32 tab_col = GetColorU32((held || hovered) ? ImGuiCol_TabHovered : tab_contents_visible ? (tab_bar_focused ? ImGuiCol_TabSelected : ImGuiCol_TabDimmedSelected) : (tab_bar_focused ? ImGuiCol_Tab : ImGuiCol_TabDimmed));
|
||||
TabItemBackground(display_draw_list, bb, flags, tab_col);
|
||||
if (tab_contents_visible && (tab_bar->Flags & ImGuiTabBarFlags_DrawSelectedOverline))
|
||||
{
|
||||
float x_offset = IM_TRUNC(0.4f * style.TabRounding);
|
||||
if (x_offset < 2.0f * g.CurrentDpiScale)
|
||||
x_offset = 0.0f;
|
||||
float y_offset = 1.0f * g.CurrentDpiScale;
|
||||
display_draw_list->AddLine(bb.GetTL() + ImVec2(x_offset, y_offset), bb.GetTR() + ImVec2(-x_offset, y_offset), GetColorU32(tab_bar_focused ? ImGuiCol_TabSelectedOverline : ImGuiCol_TabDimmedSelectedOverline), 2.0f * g.CurrentDpiScale);
|
||||
}
|
||||
RenderNavHighlight(bb, id);
|
||||
|
||||
// Select with right mouse button. This is so the common idiom for context menu automatically highlight the current widget.
|
||||
|
||||
Reference in New Issue
Block a user