mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-10-31 10:02:30 +01:00 
			
		
		
		
	Cocoa: TSpeedButton: set the highlighted background color when pressed, consistent with win32
before, TSpeedButton had a white highlighted background color when it was normal, and a gray background when it was pressed, causing confusion to users.
This commit is contained in:
		
							parent
							
								
									eb65e0684e
								
							
						
					
					
						commit
						feae93368d
					
				| @ -898,6 +898,8 @@ begin | |||||||
|         BtnType := NSPushOnPushOffButton; |         BtnType := NSPushOnPushOffButton; | ||||||
|         BezelStyle := BezelButton; |         BezelStyle := BezelButton; | ||||||
|         useBezel := true; |         useBezel := true; | ||||||
|  |         if IsPushed(Details) then | ||||||
|  |           btn.setBackgroundColor(NSColor.selectedTextBackgroundColor); | ||||||
|       end; |       end; | ||||||
|     else |     else | ||||||
|       Result := false; |       Result := false; | ||||||
| @ -922,6 +924,7 @@ begin | |||||||
|   btn.setHighlighted( IsPushed(Details)); |   btn.setHighlighted( IsPushed(Details)); | ||||||
| 
 | 
 | ||||||
|   if ((Details.Element = teToolBar) and (not IsPushed(Details)) and (not IsChecked(Details))) |   if ((Details.Element = teToolBar) and (not IsPushed(Details)) and (not IsChecked(Details))) | ||||||
|  |     or ((Details.Element = teButton) and (Details.Part = BP_PUSHBUTTON) and IsPushed(Details)) | ||||||
|     or ((Details.Element = teButton) and (Details.Part = BP_CHECKBOX)) |     or ((Details.Element = teButton) and (Details.Part = BP_CHECKBOX)) | ||||||
|   then |   then | ||||||
|     // this is "flat" mode. So unpushed state should draw no borders |     // this is "flat" mode. So unpushed state should draw no borders | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 rich2014
						rich2014