1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:38:10 +00:00

Profiler: Use AK::Variant for type-specific data in Profile::Event

Each event has a different set of data depending on the event type.
This commit is contained in:
Andreas Kling 2021-08-13 21:04:52 +02:00
parent f51f5e135a
commit f5db92448d
3 changed files with 108 additions and 67 deletions

View file

@ -135,7 +135,8 @@ void TimelineTrack::mousemove_event(GUI::MouseEvent& event)
constexpr int hoverable_padding = 2;
Gfx::IntRect hoverable_rect { x - hoverable_padding, frame_thickness(), hoverable_padding * 2, height() - frame_thickness() * 2 };
if (hoverable_rect.contains_horizontally(event.x())) {
GUI::Application::the()->show_tooltip_immediately(String::formatted("{}, {}", signpost.signpost_string, signpost.arg2), this);
auto const& data = signpost.data.template get<Profile::Event::SignpostData>();
GUI::Application::the()->show_tooltip_immediately(String::formatted("{}, {}", data.string, data.arg), this);
hovering_a_signpost = true;
return IterationDecision::Break;
}