mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:17:35 +00:00
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. :^)
This commit is contained in:
parent
59da118f2e
commit
fb6d236ba2
7 changed files with 201 additions and 21 deletions
35
Userland/DevTools/Profiler/TimelineContainer.h
Normal file
35
Userland/DevTools/Profiler/TimelineContainer.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* 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;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue