mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 20:12:43 +00:00 
			
		
		
		
	LibGUI+Taskbar: Don't immediately repaint checkable Buttons
Unlike regular buttons, unchecked checkables don't need to repaint on MouseUp to feel responsive when clicking rapidly. In fact, this can lead to a flickering effect when a bogus unchecked state gets painted again before the button's checked one.
This commit is contained in:
		
							parent
							
								
									56a719daf8
								
							
						
					
					
						commit
						12ee92004d
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -134,7 +134,8 @@ void AbstractButton::mouseup_event(MouseEvent& event) | |||
|         bool was_being_pressed = m_being_pressed; | ||||
|         m_being_pressed = false; | ||||
|         m_pressed_mouse_button = MouseButton::None; | ||||
|         repaint(); | ||||
|         if (!is_checkable() || is_checked()) | ||||
|             repaint(); | ||||
|         if (was_being_pressed && !was_auto_repeating) { | ||||
|             switch (event.button()) { | ||||
|             case MouseButton::Primary: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 thankyouverycool
						thankyouverycool