mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 10:42:45 +00:00 
			
		
		
		
	LibGUI+Inspector: Highlight the currently remotely inspected widget
This patch adds a magenta rectangle around the currently inspected widget. This allows you to browse an app's widget tree somewhat visually using the Inspector. :^)
This commit is contained in:
		
							parent
							
								
									d16f8214d8
								
							
						
					
					
						commit
						e23c5b7e83
					
				
					 5 changed files with 29 additions and 0 deletions
				
			
		|  | @ -240,6 +240,11 @@ void Widget::handle_paint_event(PaintEvent& event) | |||
|         return IterationDecision::Continue; | ||||
|     }); | ||||
|     second_paint_event(event); | ||||
| 
 | ||||
|     if (is_being_inspected()) { | ||||
|         Painter painter(*this); | ||||
|         painter.draw_rect(rect(), Color::Magenta); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| void Widget::set_layout(NonnullRefPtr<Layout> layout) | ||||
|  | @ -763,4 +768,14 @@ Gfx::Palette Widget::palette() const | |||
|     return Gfx::Palette(*m_palette); | ||||
| } | ||||
| 
 | ||||
| void Widget::did_begin_inspection() | ||||
| { | ||||
|     update(); | ||||
| } | ||||
| 
 | ||||
| void Widget::did_end_inspection() | ||||
| { | ||||
|     update(); | ||||
| } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling