Profiler: Display tooltip when hovering over flamegraph bars

This commit is contained in:
Rok Povsic 2021-12-19 13:56:21 +01:00 committed by Andreas Kling
parent d3a80b1a6e
commit a3c732b8ae
Notes: sideshowbarker 2024-07-17 22:34:20 +09:00

View file

@ -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();
}