mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:22:44 +00:00 
			
		
		
		
	 cea7dbce42
			
		
	
	
		cea7dbce42
		
	
	
	
	
		
			
			Outlines are in theory implemented (though I'm having trouble finding a simple PDF with outlines to test it on), and thumbnails are not.
		
			
				
	
	
		
			35 lines
		
	
	
	
		
			791 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
	
		
			791 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Matthew Olsson <mattco@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include "OutlineModel.h"
 | |
| #include <LibGUI/TreeView.h>
 | |
| #include <LibGUI/Widget.h>
 | |
| 
 | |
| class SidebarWidget final : public GUI::Widget {
 | |
|     C_OBJECT(SidebarWidget)
 | |
| 
 | |
| public:
 | |
|     ~SidebarWidget() override = default;
 | |
| 
 | |
|     void set_outline(RefPtr<PDF::OutlineDict> outline)
 | |
|     {
 | |
|         if (outline) {
 | |
|             m_model = OutlineModel::create(outline.release_nonnull());
 | |
|             m_outline_tree_view->set_model(m_model);
 | |
|         } else {
 | |
|             m_model = RefPtr<OutlineModel> {};
 | |
|             m_outline_tree_view->set_model({});
 | |
|         }
 | |
|     }
 | |
| 
 | |
| private:
 | |
|     SidebarWidget();
 | |
| 
 | |
|     RefPtr<OutlineModel> m_model;
 | |
|     RefPtr<GUI::TreeView> m_outline_tree_view;
 | |
| };
 |