mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:17:34 +00:00
Profiler: Display tooltip when hovering over flamegraph bars
This commit is contained in:
parent
d3a80b1a6e
commit
a3c732b8ae
1 changed files with 8 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
||||||
#include "LibGfx/Forward.h"
|
#include "LibGfx/Forward.h"
|
||||||
#include <AK/Function.h>
|
#include <AK/Function.h>
|
||||||
#include <LibGUI/Painter.h>
|
#include <LibGUI/Painter.h>
|
||||||
|
#include <LibGUI/Widget.h>
|
||||||
#include <LibGfx/FontDatabase.h>
|
#include <LibGfx/FontDatabase.h>
|
||||||
#include <LibGfx/Palette.h>
|
#include <LibGfx/Palette.h>
|
||||||
|
|
||||||
|
@ -83,6 +84,13 @@ void FlameGraphView::mousemove_event(GUI::MouseEvent& event)
|
||||||
if (on_hover_change)
|
if (on_hover_change)
|
||||||
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();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue