|
|
|
@ -5511,7 +5511,7 @@ void ImGui::RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& titl
|
|
|
|
|
const ImVec2 text_size = CalcTextSize(name, NULL, true) + ImVec2(marker_size_x, 0.0f);
|
|
|
|
|
|
|
|
|
|
// As a nice touch we try to ensure that centered title text doesn't get affected by visibility of Close/Collapse button,
|
|
|
|
|
// while uncentered title text will still reach edges correct.
|
|
|
|
|
// while uncentered title text will still reach edges correctly.
|
|
|
|
|
if (pad_l > style.FramePadding.x)
|
|
|
|
|
pad_l += g.Style.ItemInnerSpacing.x;
|
|
|
|
|
if (pad_r > style.FramePadding.x)
|
|
|
|
@ -5525,8 +5525,9 @@ void ImGui::RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& titl
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ImRect layout_r(title_bar_rect.Min.x + pad_l, title_bar_rect.Min.y, title_bar_rect.Max.x - pad_r, title_bar_rect.Max.y);
|
|
|
|
|
ImRect clip_r(layout_r.Min.x, layout_r.Min.y, layout_r.Max.x + g.Style.ItemInnerSpacing.x, layout_r.Max.y);
|
|
|
|
|
//if (g.IO.KeyCtrl) window->DrawList->AddRect(layout_r.Min, layout_r.Max, IM_COL32(255, 128, 0, 255)); // [DEBUG]
|
|
|
|
|
ImRect clip_r(layout_r.Min.x, layout_r.Min.y, ImMin(layout_r.Max.x + g.Style.ItemInnerSpacing.x, title_bar_rect.Max.x), layout_r.Max.y);
|
|
|
|
|
//if (g.IO.KeyShift) window->DrawList->AddRect(layout_r.Min, layout_r.Max, IM_COL32(255, 128, 0, 255)); // [DEBUG]
|
|
|
|
|
//if (g.IO.KeyCtrl) window->DrawList->AddRect(clip_r.Min, clip_r.Max, IM_COL32(255, 128, 0, 255)); // [DEBUG]
|
|
|
|
|
RenderTextClipped(layout_r.Min, layout_r.Max, name, NULL, &text_size, style.WindowTitleAlign, &clip_r);
|
|
|
|
|
if (flags & ImGuiWindowFlags_UnsavedDocument)
|
|
|
|
|
{
|
|
|
|
@ -6118,7 +6119,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|
|
|
|
|
|
|
|
|
// Title bar
|
|
|
|
|
if (!(flags & ImGuiWindowFlags_NoTitleBar))
|
|
|
|
|
RenderWindowTitleBarContents(window, title_bar_rect, name, p_open);
|
|
|
|
|
RenderWindowTitleBarContents(window, ImRect(title_bar_rect.Min.x + window->WindowBorderSize, title_bar_rect.Min.y, title_bar_rect.Max.x - window->WindowBorderSize, title_bar_rect.Max.y), name, p_open);
|
|
|
|
|
|
|
|
|
|
// Clear hit test shape every frame
|
|
|
|
|
window->HitTestHoleSize.x = window->HitTestHoleSize.y = 0;
|
|
|
|
|