mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 20:52:45 +00:00 
			
		
		
		
	 2ad9c1fd6c
			
		
	
	
		2ad9c1fd6c
		
	
	
	
	
		
			
			The checkbox provided by ClassicStylePainter is not scaling-aware and generally unflexible, instead use the UA default stylesheet with a handful of properties, the same way we already style buttons and text inputs. Thanks to Xexxa for the nice checkmark image! Co-Authored-By: Xexxa <93391300+Xexxa@users.noreply.github.com>
		
			
				
	
	
		
			36 lines
		
	
	
	
		
			918 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
	
		
			918 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <LibGUI/Event.h>
 | |
| #include <LibWeb/HTML/BrowsingContext.h>
 | |
| #include <LibWeb/HTML/HTMLImageElement.h>
 | |
| #include <LibWeb/Layout/CheckBox.h>
 | |
| #include <LibWeb/Layout/Label.h>
 | |
| #include <LibWeb/Painting/CheckBoxPaintable.h>
 | |
| 
 | |
| namespace Web::Painting {
 | |
| 
 | |
| JS::NonnullGCPtr<CheckBoxPaintable> CheckBoxPaintable::create(Layout::CheckBox const& layout_box)
 | |
| {
 | |
|     return layout_box.heap().allocate_without_realm<CheckBoxPaintable>(layout_box);
 | |
| }
 | |
| 
 | |
| CheckBoxPaintable::CheckBoxPaintable(Layout::CheckBox const& layout_box)
 | |
|     : LabelablePaintable(layout_box)
 | |
| {
 | |
| }
 | |
| 
 | |
| Layout::CheckBox const& CheckBoxPaintable::layout_box() const
 | |
| {
 | |
|     return static_cast<Layout::CheckBox const&>(layout_node());
 | |
| }
 | |
| 
 | |
| Layout::CheckBox& CheckBoxPaintable::layout_box()
 | |
| {
 | |
|     return static_cast<Layout::CheckBox&>(layout_node());
 | |
| }
 | |
| 
 | |
| }
 |