diff options
author | Rok Povsic <rok.povsic@gmail.com> | 2021-12-19 13:56:21 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-12-20 11:31:47 +0100 |
commit | a3c732b8aeadb3cb3563d1bb717bbe26d625eb50 (patch) | |
tree | 71a8faf0a036481a1890b56c039cfa86a6bc8fc4 /Userland/DevTools | |
parent | d3a80b1a6e66ed1d142eea06fc873861c1497039 (diff) | |
download | serenity-a3c732b8aeadb3cb3563d1bb717bbe26d625eb50.zip |
Profiler: Display tooltip when hovering over flamegraph bars
Diffstat (limited to 'Userland/DevTools')
-rw-r--r-- | Userland/DevTools/Profiler/FlameGraphView.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/DevTools/Profiler/FlameGraphView.cpp b/Userland/DevTools/Profiler/FlameGraphView.cpp index c2dcbdc36f..5a7c6d4bab 100644 --- a/Userland/DevTools/Profiler/FlameGraphView.cpp +++ b/Userland/DevTools/Profiler/FlameGraphView.cpp @@ -9,6 +9,7 @@ #include "LibGfx/Forward.h" #include <AK/Function.h> #include <LibGUI/Painter.h> +#include <LibGUI/Widget.h> #include <LibGfx/FontDatabase.h> #include <LibGfx/Palette.h> @@ -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(); } |