mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 00:02:50 +02:00
Cocoa: make MenuItem State Images configurable
This commit is contained in:
parent
1ee73b9b31
commit
3f43638383
@ -6,7 +6,7 @@ unit CocoaConfig;
|
||||
interface
|
||||
|
||||
uses
|
||||
CocoaAll, Cocoa_Extra;
|
||||
CocoaAll, Cocoa_Extra, CocoaConst;
|
||||
|
||||
var
|
||||
// for compatiblity with LCL 1.8 release. The macOS base is 72ppi
|
||||
@ -26,6 +26,10 @@ var
|
||||
// default NSTableViewStyle
|
||||
CocoaTableViewStyle : NSTableViewStyle = NSTableViewStyleAutomatic;
|
||||
|
||||
// default Image Name for MenuItem
|
||||
CocoaDefaultCheckMenuImageName : NSString;
|
||||
CocoaDefaultRadioMenuImageName : NSString;
|
||||
|
||||
{$ifdef COCOALOOPHIJACK}
|
||||
// The flag is set to true once hi-jacked loop is finished (at the end of app)
|
||||
// The flag is checked in Menus to avoid "double" Cmd+Q menu
|
||||
@ -34,5 +38,9 @@ var
|
||||
|
||||
implementation
|
||||
|
||||
initialization
|
||||
CocoaDefaultCheckMenuImageName:= NSSTR('NSMenuCheckmark');
|
||||
CocoaDefaultRadioMenuImageName:= NSSTR('NSDatePickerCalendarHome');
|
||||
|
||||
end.
|
||||
|
||||
|
@ -33,7 +33,7 @@ uses
|
||||
// Widgetset
|
||||
WSMenus,
|
||||
// LCL Cocoa
|
||||
CocoaInt, CocoaMenus, CocoaWSCommon, CocoaUtils, CocoaGDIObjects;
|
||||
CocoaConfig, CocoaInt, CocoaMenus, CocoaWSCommon, CocoaUtils, CocoaGDIObjects;
|
||||
|
||||
type
|
||||
|
||||
@ -162,12 +162,12 @@ end;
|
||||
// used from the MenuMadness example
|
||||
class function TCocoaWSMenuItem.NSMenuCheckmark: NSImage;
|
||||
begin
|
||||
Result:=NSImage.imageNamed(NSStringUtf8('NSMenuCheckmark'));
|
||||
Result:=NSImage.imageNamed(CocoaConfig.CocoaDefaultCheckMenuImageName);
|
||||
end;
|
||||
|
||||
class function TCocoaWSMenuItem.NSMenuRadio: NSImage;
|
||||
begin
|
||||
Result:=NSImage.imageNamed(NSStringUtf8('NSDatePickerCalendarHome'))
|
||||
Result:=NSImage.imageNamed(CocoaConfig.CocoaDefaultRadioMenuImageName)
|
||||
end;
|
||||
|
||||
class function TCocoaWSMenuItem.isSeparator(const ACaption: AnsiString): Boolean;
|
||||
|
Loading…
Reference in New Issue
Block a user