Skip to content

Commit

Permalink
Docking: Fixed incorrectly rounded tab bars for dock node that are no…
Browse files Browse the repository at this point in the history
…t at the top of their dock tree.
  • Loading branch information
ocornut committed Dec 1, 2021
1 parent 848d21b commit 44771a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Docking+Viewports Branch:
- Docking: Revert removal of io.ConfigDockingWithShift config option (removed in 1.83). (#4643)
- Docking: Fixed a bug undocking windows docked into a non-visible or _KeepAliveOnly dockspace
when unrelated windows submitted before the dockspace have dynamic visibility. (#4757)
- Docking: Fixed incorrectly rounded tab bars for dock node that are not at the top of their dock tree.
- Viewports: Made it possible to explicitly assign ImGuiWindowClass::ParentViewportId to 0 in order
to ensure a window is not parented. Previously this would use the global default (which might be 0,
but not always as it would depend on io.ConfigViewportsNoDefaultParent). (#3152, #2871)
Expand Down
7 changes: 5 additions & 2 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4646,7 +4646,7 @@ static void ImGui::EndFrameDrawDimmedBackgrounds()
draw_list->AddRectFilled(viewport->Pos, viewport->Pos + viewport->Size, dim_bg_col);
}

// Draw modal whitening background between CTRL-TAB list
// Draw modal whitening background behind CTRL-TAB list
if (dim_bg_for_window_list && g.NavWindowingTargetAnim->Active)
{
// Choose a draw list that will be front-most across all our children
Expand Down Expand Up @@ -14488,7 +14488,10 @@ static void ImGui::DockNodeUpdateTabBar(ImGuiDockNode* node, ImGuiWindow* host_w
if (is_focused)
node->LastFrameFocused = g.FrameCount;
ImU32 title_bar_col = GetColorU32(host_window->Collapsed ? ImGuiCol_TitleBgCollapsed : is_focused ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBg);
host_window->DrawList->AddRectFilled(title_bar_rect.Min, title_bar_rect.Max, title_bar_col, host_window->WindowRounding, ImDrawFlags_RoundCornersTop);
bool rounding_tl = node->Pos.x <= host_window->Pos.x + DOCKING_SPLITTER_SIZE;
bool rounding_tr = node->Pos.x + node->Size.x >= host_window->Pos.x + host_window->Size.x - DOCKING_SPLITTER_SIZE;
ImDrawFlags rounding_flags = ImDrawFlags_RoundCornersNone | (rounding_tl ? ImDrawFlags_RoundCornersTopLeft : 0) | (rounding_tr ? ImDrawFlags_RoundCornersTopRight : 0);
host_window->DrawList->AddRectFilled(title_bar_rect.Min, title_bar_rect.Max, title_bar_col, host_window->WindowRounding, rounding_flags);

// Docking/Collapse button
if (has_window_menu_button)
Expand Down

0 comments on commit 44771a1

Please sign in to comment.