mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-06 06:25:54 +01:00
Merge 4c93eaa5549b5533b83e98a31e878d659fda841b into 0cb6f6501cc1dd7e20679f4a133092da0396529e
This commit is contained in:
commit
b35bca825b
25
imgui.cpp
25
imgui.cpp
@ -3965,6 +3965,7 @@ const char* ImGui::GetStyleColorName(ImGuiCol idx)
|
||||
case ImGuiCol_ChildBg: return "ChildBg";
|
||||
case ImGuiCol_PopupBg: return "PopupBg";
|
||||
case ImGuiCol_Border: return "Border";
|
||||
case ImGuiCol_WindowBorderSelected: return "WindowBorderSelected";
|
||||
case ImGuiCol_BorderShadow: return "BorderShadow";
|
||||
case ImGuiCol_FrameBg: return "FrameBg";
|
||||
case ImGuiCol_FrameBgHovered: return "FrameBgHovered";
|
||||
@ -7832,6 +7833,30 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
|
||||
// Borders (for dock node host they will be rendered over after the tab bar)
|
||||
if (handle_borders_and_resize_grips && !window->DockNodeAsHost)
|
||||
RenderWindowOuterBorders(window);
|
||||
|
||||
// Selected border
|
||||
const float border_size = window->WindowBorderSize;
|
||||
bool is_window_selected = border_size > 0.0f;
|
||||
if (!(window->Flags & (ImGuiWindowFlags_ChildMenu | ImGuiWindowFlags_Popup)))
|
||||
{
|
||||
// Regular window
|
||||
if (!(window->Flags & (ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_MenuBar)))
|
||||
is_window_selected &= g.WindowsFocusOrder.back() == window;
|
||||
else
|
||||
is_window_selected = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// BeginPopup/BeginMenu
|
||||
is_window_selected &= g.OpenPopupStack.back().Window == window && g.WindowsFocusOrder.back() == window->RootWindow;
|
||||
}
|
||||
// When docked, only show selected border if the dock node is focused
|
||||
is_window_selected &= (!window->DockIsActive || window->DockNode->IsFocused);
|
||||
if (is_window_selected)
|
||||
{
|
||||
const ImU32 border_selected_col = GetColorU32(ImGuiCol_WindowBorderSelected);
|
||||
window->DrawList->AddRect(window->Pos, window->Pos + window->Size, border_selected_col, window_rounding, 0, border_size);
|
||||
}
|
||||
}
|
||||
window->DC.NavLayerCurrent = ImGuiNavLayer_Main;
|
||||
}
|
||||
|
||||
1
imgui.h
1
imgui.h
@ -1861,6 +1861,7 @@ enum ImGuiCol_
|
||||
ImGuiCol_Text,
|
||||
ImGuiCol_TextDisabled,
|
||||
ImGuiCol_WindowBg, // Background of normal windows
|
||||
ImGuiCol_WindowBorderSelected, // border of selected normal windows
|
||||
ImGuiCol_ChildBg, // Background of child windows
|
||||
ImGuiCol_PopupBg, // Background of popups, menus, tooltips windows
|
||||
ImGuiCol_Border,
|
||||
|
||||
@ -192,6 +192,7 @@ void ImGui::StyleColorsDark(ImGuiStyle* dst)
|
||||
colors[ImGuiCol_Text] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
|
||||
colors[ImGuiCol_TextDisabled] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f);
|
||||
colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.06f, 0.06f, 0.94f);
|
||||
colors[ImGuiCol_WindowBorderSelected] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
|
||||
colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
|
||||
colors[ImGuiCol_PopupBg] = ImVec4(0.08f, 0.08f, 0.08f, 0.94f);
|
||||
colors[ImGuiCol_Border] = ImVec4(0.43f, 0.43f, 0.50f, 0.50f);
|
||||
@ -262,6 +263,7 @@ void ImGui::StyleColorsClassic(ImGuiStyle* dst)
|
||||
colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f);
|
||||
colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
|
||||
colors[ImGuiCol_WindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.85f);
|
||||
colors[ImGuiCol_WindowBorderSelected] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
|
||||
colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
|
||||
colors[ImGuiCol_PopupBg] = ImVec4(0.11f, 0.11f, 0.14f, 0.92f);
|
||||
colors[ImGuiCol_Border] = ImVec4(0.50f, 0.50f, 0.50f, 0.50f);
|
||||
@ -333,6 +335,7 @@ void ImGui::StyleColorsLight(ImGuiStyle* dst)
|
||||
colors[ImGuiCol_Text] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
|
||||
colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
|
||||
colors[ImGuiCol_WindowBg] = ImVec4(0.94f, 0.94f, 0.94f, 1.00f);
|
||||
colors[ImGuiCol_WindowBorderSelected] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
|
||||
colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
|
||||
colors[ImGuiCol_PopupBg] = ImVec4(1.00f, 1.00f, 1.00f, 0.98f);
|
||||
colors[ImGuiCol_Border] = ImVec4(0.00f, 0.00f, 0.00f, 0.30f);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user