mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
TabBar, Style: added style option for the size of the Tab-Bar Overline (#7804)
Amend 21bda2e.
This commit is contained in:
parent
eb72b5a8ee
commit
da36336321
5 changed files with 13 additions and 4 deletions
|
|
@ -9917,13 +9917,13 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
|
|||
ImDrawList* display_draw_list = window->DrawList;
|
||||
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))
|
||||
if (tab_contents_visible && (tab_bar->Flags & ImGuiTabBarFlags_DrawSelectedOverline) && style.TabBarOverlineSize > 0.0f)
|
||||
{
|
||||
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);
|
||||
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), style.TabBarOverlineSize);
|
||||
}
|
||||
RenderNavHighlight(bb, id);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue