From d71eb2cf39cad75b36c7514df5eff741d4f939df Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 20 Mar 2021 20:59:31 -0700 Subject: [PATCH] [glass] Plot: Show full source name as tooltip and in popup (#3255) --- glass/src/lib/native/cpp/other/Plot.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/glass/src/lib/native/cpp/other/Plot.cpp b/glass/src/lib/native/cpp/other/Plot.cpp index d850b626dc..e8d9de6810 100644 --- a/glass/src/lib/native/cpp/other/Plot.cpp +++ b/glass/src/lib/native/cpp/other/Plot.cpp @@ -374,9 +374,15 @@ PlotSeries::Action PlotSeries::EmitPlot(PlotView& view, double now, size_t i, ImPlot::EndLegendDragDropSource(); } + // Show full source name tooltip + if (!m_name.empty() && ImPlot::IsLegendEntryHovered(label)) { + ImGui::SetTooltip("%s", m_id.c_str()); + } + // Edit settings via popup Action rv = kNone; if (ImPlot::BeginLegendPopup(label)) { + ImGui::TextUnformatted(m_id.c_str()); if (ImGui::Button("Close")) { ImGui::CloseCurrentPopup(); }