mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:12:45 +00:00 
			
		
		
		
	GWidget: Implement set_backcolor() and set_forecolor()
These are set-color-from-string variants used by the VisualBuilder's code generator.
This commit is contained in:
		
							parent
							
								
									54c77cb714
								
							
						
					
					
						commit
						47511b5930
					
				
					 2 changed files with 18 additions and 3 deletions
				
			
		|  | @ -569,3 +569,19 @@ void GWidget::focus_next_widget() | |||
|             focusable_widgets.first()->set_focus(true); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| void GWidget::set_backcolor(const StringView& color_string) | ||||
| { | ||||
|     auto color = Color::from_string(color_string); | ||||
|     if (!color.has_value()) | ||||
|         return; | ||||
|     set_background_color(color.value()); | ||||
| } | ||||
| 
 | ||||
| void GWidget::set_forecolor(const StringView& color_string) | ||||
| { | ||||
|     auto color = Color::from_string(color_string); | ||||
|     if (!color.has_value()) | ||||
|         return; | ||||
|     set_foreground_color(color.value()); | ||||
| } | ||||
|  |  | |||
|  | @ -137,9 +137,8 @@ public: | |||
|     void set_background_color(Color color) { m_background_color = color; } | ||||
|     void set_foreground_color(Color color) { m_foreground_color = color; } | ||||
| 
 | ||||
|     // FIXME: Implement these.
 | ||||
|     void set_backcolor(const StringView&) {} | ||||
|     void set_forecolor(const StringView&) {} | ||||
|     void set_backcolor(const StringView&); | ||||
|     void set_forecolor(const StringView&); | ||||
| 
 | ||||
|     void set_autofill(bool b) { set_fill_with_background_color(b); } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling