mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 21:52:45 +00:00 
			
		
		
		
	MouseDemo: Show distinct colors for primary vs secondary button
This shows mouse down of primary button in blue color, and secondary button in light blue color.
This commit is contained in:
		
							parent
							
								
									903bfc3d68
								
							
						
					
					
						commit
						2c142e4c57
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		|  | @ -79,13 +79,15 @@ public: | ||||||
|         auto secondary_pressed = m_buttons & GUI::MouseButton::Secondary; |         auto secondary_pressed = m_buttons & GUI::MouseButton::Secondary; | ||||||
| 
 | 
 | ||||||
|         if (primary_secondary_switched ? secondary_pressed : primary_pressed) { |         if (primary_secondary_switched ? secondary_pressed : primary_pressed) { | ||||||
|             painter.fill_rect({ 31, 21, 34, 44 }, Color::Blue); |             auto button_color = primary_secondary_switched ? Color::LightBlue : Color::MidBlue; | ||||||
|             painter.draw_triangle({ 30, 21 }, { 65, 21 }, { 65, 12 }, Color::Blue); |             painter.fill_rect({ 31, 21, 34, 44 }, button_color); | ||||||
|  |             painter.draw_triangle({ 30, 21 }, { 65, 21 }, { 65, 12 }, button_color); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (primary_secondary_switched ? primary_pressed : secondary_pressed) { |         if (primary_secondary_switched ? primary_pressed : secondary_pressed) { | ||||||
|             painter.fill_rect({ 96, 21, 34, 44 }, Color::Blue); |             auto button_color = primary_secondary_switched ? Color::MidBlue : Color::LightBlue; | ||||||
|             painter.draw_triangle({ 96, 12 }, { 96, 21 }, { 132, 21 }, Color::Blue); |             painter.fill_rect({ 96, 21, 34, 44 }, button_color); | ||||||
|  |             painter.draw_triangle({ 96, 12 }, { 96, 21 }, { 132, 21 }, button_color); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (m_buttons & GUI::MouseButton::Middle) |         if (m_buttons & GUI::MouseButton::Middle) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Oppebøen
						Andreas Oppebøen