mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 04:32:44 +00:00 
			
		
		
		
	 cb0c5390ff
			
		
	
	
		cb0c5390ff
		
	
	
	
	
		
			
			Input events have nothing to do with layout, so let's not send them to layout nodes. The job of Paintable starts to become clear. It represents a paintable item that can be rendered into the viewport, which means it can also be targeted by the mouse cursor.
		
			
				
	
	
		
			28 lines
		
	
	
	
		
			810 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
	
		
			810 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibWeb/HTML/HTMLInputElement.h>
 | |
| #include <LibWeb/Layout/LabelableNode.h>
 | |
| 
 | |
| namespace Web::Layout {
 | |
| 
 | |
| class ButtonBox : public LabelableNode {
 | |
| public:
 | |
|     ButtonBox(DOM::Document&, HTML::HTMLInputElement&, NonnullRefPtr<CSS::StyleProperties>);
 | |
|     virtual ~ButtonBox() override;
 | |
| 
 | |
|     virtual void prepare_for_replaced_layout() override;
 | |
| 
 | |
|     const HTML::HTMLInputElement& dom_node() const { return static_cast<const HTML::HTMLInputElement&>(LabelableNode::dom_node()); }
 | |
|     HTML::HTMLInputElement& dom_node() { return static_cast<HTML::HTMLInputElement&>(LabelableNode::dom_node()); }
 | |
| 
 | |
| private:
 | |
|     virtual RefPtr<Painting::Paintable> create_paintable() const override;
 | |
| };
 | |
| 
 | |
| }
 |