mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 07:50:20 +02:00
cocoa: support for dynamic tooltip color. #34260
git-svn-id: trunk@58965 -
This commit is contained in:
parent
8e92c0d649
commit
28dc96b03e
@ -126,7 +126,15 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
const
|
const
|
||||||
NSAppKitVersionNumber10_7 = 1138; // defined in NSApplication.h
|
// defined in NSApplication.h
|
||||||
|
NSAppKitVersionNumber10_5 = 949;
|
||||||
|
NSAppKitVersionNumber10_6 = 1038;
|
||||||
|
NSAppKitVersionNumber10_7 = 1138;
|
||||||
|
NSAppKitVersionNumber10_8 = 1187;
|
||||||
|
NSAppKitVersionNumber10_9 = 1265;
|
||||||
|
NSAppKitVersionNumber10_10 = 1343;
|
||||||
|
NSAppKitVersionNumber10_11 = 1404;
|
||||||
|
NSAppKitVersionNumber10_12 = 1504;
|
||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
|
@ -173,6 +173,11 @@ var
|
|||||||
CocoaBasePPI : Integer = 96; // for compatiblity with LCL 1.8 release. The macOS base is 72ppi
|
CocoaBasePPI : Integer = 96; // for compatiblity with LCL 1.8 release. The macOS base is 72ppi
|
||||||
MainPool : NSAutoreleasePool = nil;
|
MainPool : NSAutoreleasePool = nil;
|
||||||
|
|
||||||
|
ColorToolTip : TColorRef = $C9FCF9; // default = macosx10.4 yellow color. (See InitInternals below)
|
||||||
|
// it's likely the tooltip color will change in future.
|
||||||
|
// Thus the variable is left public, so a user of LCL
|
||||||
|
// would be able to initialize it properly on start
|
||||||
|
|
||||||
function CocoaScrollBarSetScrollInfo(bar: TCocoaScrollBar; const ScrollInfo: TScrollInfo): Integer;
|
function CocoaScrollBarSetScrollInfo(bar: TCocoaScrollBar; const ScrollInfo: TScrollInfo): Integer;
|
||||||
function CocoaScrollBarGetScrollInfo(bar: TCocoaScrollBar; var ScrollInfo: TScrollInfo): Boolean;
|
function CocoaScrollBarGetScrollInfo(bar: TCocoaScrollBar; var ScrollInfo: TScrollInfo): Boolean;
|
||||||
procedure NSScrollerGetScrollInfo(docSz, pageSz: CGFloat; rl: NSSCroller; Var ScrollInfo: TScrollInfo);
|
procedure NSScrollerGetScrollInfo(docSz, pageSz: CGFloat; rl: NSSCroller; Var ScrollInfo: TScrollInfo);
|
||||||
@ -404,6 +409,14 @@ begin
|
|||||||
// MacOSX 10.6 reports a lot of warnings during initialization process
|
// MacOSX 10.6 reports a lot of warnings during initialization process
|
||||||
// adding the autorelease pool for the whole Cocoa widgetset
|
// adding the autorelease pool for the whole Cocoa widgetset
|
||||||
MainPool := NSAutoreleasePool.alloc.init;
|
MainPool := NSAutoreleasePool.alloc.init;
|
||||||
|
|
||||||
|
// Apple doesn't provide any reasonable way of aquiring tooltip bk color
|
||||||
|
// todo: The tooltip color could be different depending on "light" or "dark"
|
||||||
|
// mode selected in the system. Thus actual Theme Drawing should be used
|
||||||
|
// and implemeneted.
|
||||||
|
if NSAppKitVersionNumber >= NSAppKitVersionNumber10_10 then
|
||||||
|
ColorTooltip := $EDEDED;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure InternalFinal;
|
procedure InternalFinal;
|
||||||
|
@ -1593,7 +1593,7 @@ begin
|
|||||||
COLOR_3DLIGHT:
|
COLOR_3DLIGHT:
|
||||||
Result := NSColor.controlHighlightColor;// makes a more consistent result (a very light gray) than controlLightHighlightColor (which is white)
|
Result := NSColor.controlHighlightColor;// makes a more consistent result (a very light gray) than controlLightHighlightColor (which is white)
|
||||||
COLOR_INFOBK:
|
COLOR_INFOBK:
|
||||||
Result := NSColor.colorWithCalibratedRed_green_blue_alpha(249 / $FF, 252 / $FF, 201 / $FF, 1);
|
Result := ColorToNSColor(ColorToolTip);
|
||||||
else
|
else
|
||||||
Result := nil;
|
Result := nil;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user