mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:12:43 +00:00 
			
		
		
		
	 fb6d236ba2
			
		
	
	
		fb6d236ba2
		
	
	
	
	
		
			
			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. :^)
		
			
				
	
	
		
			35 lines
		
	
	
	
		
			708 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			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;
 | |
| };
 | |
| 
 | |
| }
 |