mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 03:22:43 +00:00 
			
		
		
		
	 1682f0b760
			
		
	
	
		1682f0b760
		
	
	
	
	
		
			
			SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
		
			
				
	
	
		
			48 lines
		
	
	
	
		
			939 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			48 lines
		
	
	
	
		
			939 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include "FormEditorWidget.h"
 | |
| #include "CursorTool.h"
 | |
| #include "FormWidget.h"
 | |
| #include "WidgetTreeModel.h"
 | |
| #include <LibGUI/Painter.h>
 | |
| 
 | |
| namespace HackStudio {
 | |
| 
 | |
| FormEditorWidget::FormEditorWidget()
 | |
|     : m_tool(make<CursorTool>(*this))
 | |
| {
 | |
|     set_fill_with_background_color(true);
 | |
| 
 | |
|     m_form_widget = add<FormWidget>();
 | |
|     m_widget_tree_model = WidgetTreeModel::create(*m_form_widget);
 | |
| }
 | |
| 
 | |
| FormEditorWidget::~FormEditorWidget()
 | |
| {
 | |
| }
 | |
| 
 | |
| void FormEditorWidget::paint_event(GUI::PaintEvent& event)
 | |
| {
 | |
|     GUI::Frame::paint_event(event);
 | |
| 
 | |
|     GUI::Painter painter(*this);
 | |
|     painter.add_clip_rect(event.rect());
 | |
| }
 | |
| 
 | |
| void FormEditorWidget::set_tool(NonnullOwnPtr<Tool> tool)
 | |
| {
 | |
|     m_tool->detach();
 | |
|     m_tool = move(tool);
 | |
|     m_tool->attach();
 | |
| }
 | |
| 
 | |
| WidgetTreeModel& FormEditorWidget::model()
 | |
| {
 | |
|     return *m_widget_tree_model;
 | |
| }
 | |
| 
 | |
| }
 |