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
commit f5db92448d
Notes: sideshowbarker 2024-07-18 07:00:33 +09:00
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;
}