serenity/Userland/DevTools/Profiler/TimelineContainer.h
Andreas Kling fb6d236ba2 Profiler: Add fixed track headers to the timeline view
The architecture here is a little bit convoluted. I ended up making a
new container widget (TimelineContainer) that works similarly to
GUI::ScrollableContainerWidget but has two subwidgets (a fixed header
that only scrolls vertically, and the timeline view that scrolls on
both axes.)

It would be nice to generalize this mechanism eventually and move it
back into LibGUI, but for now let's go with a special widget for
Profiler so we can continue iterating on the GUI. :^)
2021-05-06 22:18:45 +02:00

35 lines
708 B
C++

/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibGUI/AbstractScrollableWidget.h>
namespace Profiler {
class TimelineView;
class TimelineContainer : public GUI::AbstractScrollableWidget {
C_OBJECT(TimelineContainer);
public:
virtual ~TimelineContainer();
protected:
virtual void did_scroll() override;
virtual void resize_event(GUI::ResizeEvent&) override;
private:
void update_widget_sizes();
void update_widget_positions();
TimelineContainer(GUI::Widget& header_container, TimelineView&);
RefPtr<TimelineView> m_timeline_view;
RefPtr<GUI::Widget> m_header_container;
};
}