mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 09:19:32 +02:00
cocoa: forcing controlTextColor for checkbox cell embedded into a textview. #34600
git-svn-id: trunk@60030 -
This commit is contained in:
parent
f971f7d20b
commit
d7c35ad233
@ -852,6 +852,7 @@ var
|
||||
idx : Integer;
|
||||
img : NSImage;
|
||||
btn : NSTableButtonCell;
|
||||
colorTitle : NSMutableAttributedString;
|
||||
begin
|
||||
Result:=nil;
|
||||
if not isFirstColumnCheckboxes and not isImagesInCell then Exit;
|
||||
@ -878,6 +879,16 @@ begin
|
||||
//Result.setAllowsMixedState(True);
|
||||
btn.setButtonType(NSSwitchButton);
|
||||
btn.setTitle(nstxt);
|
||||
|
||||
// forced "controlTextColor" provides a better result on unfocused
|
||||
// nstablelist view with checkboxes
|
||||
colorTitle := NSMutableAttributedString.alloc.initWithAttributedString(btn.attributedTitle);
|
||||
colorTitle.addAttribute_value_range(NSForegroundColorAttributeName
|
||||
, NSColor.controlTextColor
|
||||
, NSMakeRange(0, colorTitle.length));
|
||||
btn.setAttributedTitle(colorTitle);
|
||||
colorTitle.release;
|
||||
|
||||
if chk then begin
|
||||
btn.setIntValue(1);
|
||||
btn.setCellAttribute_to(NSCellState, NSOnState);
|
||||
|
Loading…
Reference in New Issue
Block a user