mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Add dedicated style color for selected tree nodes
This commit is contained in:
parent
44aa9a4b3a
commit
77550b8d37
3 changed files with 9 additions and 2 deletions
|
|
@ -6880,9 +6880,14 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
|
|||
else
|
||||
{
|
||||
// Unframed typed for tree nodes
|
||||
if (hovered || selected)
|
||||
if (selected)
|
||||
{
|
||||
const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
|
||||
const ImU32 bg_col = GetColorU32(ImGuiCol_HeaderSelected);
|
||||
RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, false);
|
||||
}
|
||||
if (hovered)
|
||||
{
|
||||
const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : ImGuiCol_HeaderHovered);
|
||||
RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, false);
|
||||
}
|
||||
RenderNavCursor(frame_bb, id, nav_render_cursor_flags);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue