From a3c732b8aeadb3cb3563d1bb717bbe26d625eb50 Mon Sep 17 00:00:00 2001 From: Rok Povsic Date: Sun, 19 Dec 2021 13:56:21 +0100 Subject: [PATCH] Profiler: Display tooltip when hovering over flamegraph bars --- Userland/DevTools/Profiler/FlameGraphView.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Userland/DevTools/Profiler/FlameGraphView.cpp b/Userland/DevTools/Profiler/FlameGraphView.cpp index c2dcbdc36f6..5a7c6d4bab9 100644 --- a/Userland/DevTools/Profiler/FlameGraphView.cpp +++ b/Userland/DevTools/Profiler/FlameGraphView.cpp @@ -9,6 +9,7 @@ #include "LibGfx/Forward.h" #include #include +#include #include #include @@ -83,6 +84,13 @@ void FlameGraphView::mousemove_event(GUI::MouseEvent& event) if (on_hover_change) on_hover_change(); + String label = ""; + if (m_hovered_bar != nullptr && m_hovered_bar->index.is_valid()) { + label = bar_label(*m_hovered_bar); + } + set_tooltip(label); + show_or_hide_tooltip(); + update(); }