mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 04:39:22 +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;
|
idx : Integer;
|
||||||
img : NSImage;
|
img : NSImage;
|
||||||
btn : NSTableButtonCell;
|
btn : NSTableButtonCell;
|
||||||
|
colorTitle : NSMutableAttributedString;
|
||||||
begin
|
begin
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
if not isFirstColumnCheckboxes and not isImagesInCell then Exit;
|
if not isFirstColumnCheckboxes and not isImagesInCell then Exit;
|
||||||
@ -878,6 +879,16 @@ begin
|
|||||||
//Result.setAllowsMixedState(True);
|
//Result.setAllowsMixedState(True);
|
||||||
btn.setButtonType(NSSwitchButton);
|
btn.setButtonType(NSSwitchButton);
|
||||||
btn.setTitle(nstxt);
|
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
|
if chk then begin
|
||||||
btn.setIntValue(1);
|
btn.setIntValue(1);
|
||||||
btn.setCellAttribute_to(NSCellState, NSOnState);
|
btn.setCellAttribute_to(NSCellState, NSOnState);
|
||||||
|
Loading…
Reference in New Issue
Block a user