From e46aea317dda922c9a4b1d76a95fa88a14030ce4 Mon Sep 17 00:00:00 2001 From: scawful Date: Tue, 16 Jul 2024 13:38:39 -0400 Subject: [PATCH] Add the SNES color representation to the tooltip --- src/app/gui/color.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/gui/color.cc b/src/app/gui/color.cc index 49ea6581..aaa22b24 100644 --- a/src/app/gui/color.cc +++ b/src/app/gui/color.cc @@ -30,7 +30,12 @@ IMGUI_API bool SnesColorButton(absl::string_view id, SnesColor& color, // Call the original ImGui::ColorButton with the converted color bool pressed = ImGui::ColorButton(id.data(), displayColor, flags, size_arg); - + // Add the SNES color representation to the tooltip + if (ImGui::IsItemHovered()) { + ImGui::BeginTooltip(); + ImGui::Text("SNES: $%04X", color.snes()); + ImGui::EndTooltip(); + } return pressed; }