Skip to content

Commit 81cfe09

Browse files
committed
Selectable, Style: selected Selectable() use _Header color instead of an arbitrary lerp between _Header and _HeaderHovered. (#8106, #1861)
1 parent ccb6646 commit 81cfe09

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

docs/CHANGELOG.txt

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ Breaking changes:
4343

4444
Other changes:
4545

46+
- Selectable: selected Selectables use ImGuiCol_Header instead of an arbitrary lerp
47+
between _Header and _HeaderHovered which was introduced v1.91 (#8106, #1861)
4648
- Backends: DX12: Unmap() call specify written range. The range is informational and
4749
may be used by debug tools.
4850
- Backends: SDL2: Replace SDL_Vulkan_GetDrawableSize() forward declaration with the

imgui_demo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -10220,7 +10220,7 @@ struct ExampleAssetsBrowser
1022010220

1022110221
// Rendering parameters
1022210222
const ImU32 icon_type_overlay_colors[3] = { 0, IM_COL32(200, 70, 70, 255), IM_COL32(70, 170, 70, 255) };
10223-
const ImU32 icon_bg_color = ImGui::GetColorU32(ImGuiCol_MenuBarBg);
10223+
const ImU32 icon_bg_color = ImGui::GetColorU32(IM_COL32(35, 35, 35, 220));
1022410224
const ImVec2 icon_type_overlay_size = ImVec2(4.0f, 4.0f);
1022510225
const bool display_label = (LayoutItemSize.x >= ImGui::CalcTextSize("999").x);
1022610226

imgui_widgets.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -7017,12 +7017,8 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
70177017
const bool highlighted = hovered || (flags & ImGuiSelectableFlags_Highlight);
70187018
if (highlighted || selected)
70197019
{
7020-
// FIXME-MULTISELECT: Styling: Color for 'selected' elements? ImGuiCol_HeaderSelected
7021-
ImU32 col;
7022-
if (selected && !highlighted)
7023-
col = GetColorU32(ImLerp(GetStyleColorVec4(ImGuiCol_Header), GetStyleColorVec4(ImGuiCol_HeaderHovered), 0.5f));
7024-
else
7025-
col = GetColorU32((held && highlighted) ? ImGuiCol_HeaderActive : highlighted ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
7020+
// Between 1.91.0 and 1.91.4 we made selected Selectable use an arbitrary lerp between _Header and _HeaderHovered. Removed that now. (#8106)
7021+
ImU32 col = GetColorU32((held && highlighted) ? ImGuiCol_HeaderActive : highlighted ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
70267022
RenderFrame(bb.Min, bb.Max, col, false, 0.0f);
70277023
}
70287024
if (g.NavId == id)

0 commit comments

Comments
 (0)