Cocoa: NSTableView Style setting supported at Runtime

This commit is contained in:
rich2014 2023-12-05 22:27:55 +08:00
parent d4d3c1dfef
commit a99ffd317e
2 changed files with 10 additions and 4 deletions
lcl/interfaces/cocoa

View File

@ -6,10 +6,11 @@ unit CocoaConfig;
interface
uses
CocoaAll;
CocoaAll, Cocoa_Extra;
var
CocoaBasePPI : Integer = 96; // for compatiblity with LCL 1.8 release. The macOS base is 72ppi
// for compatiblity with LCL 1.8 release. The macOS base is 72ppi
CocoaBasePPI : Integer = 96;
// if set to true, then WS would not assign icons via TCocoaWSForm SetIcon
// The icon would have to be changed manually. By default LCL behaviour is used
@ -19,7 +20,11 @@ var
CocoaHideFocusNoBorder : Boolean = true;
CocoaUseLocalizedFontName : Boolean = false; // some localized named might be too long to be returned properly by APIs
// some localized named might be too long to be returned properly by APIs
CocoaUseLocalizedFontName : Boolean = false;
// default NSTableViewStyle
CocoaTableViewStyle : NSTableViewStyle = NSTableViewStyleAutomatic;
{$ifdef COCOALOOPHIJACK}
// The flag is set to true once hi-jacked loop is finished (at the end of app)

View File

@ -29,7 +29,7 @@ uses
Types, Classes, SysUtils,
// Libs
MacOSAll, CocoaAll, CocoaUtils, CocoaGDIObjects,
cocoa_extra, CocoaPrivate, CocoaConst,
cocoa_extra, CocoaPrivate, CocoaConst, CocoaConfig,
// LCL
LCLType;
@ -557,6 +557,7 @@ end;
function TCocoaTableListView.initWithFrame(frameRect: NSRect): id;
begin
Result:=inherited initWithFrame(frameRect);
setStyle( CocoaConfig.CocoaTableViewStyle );
end;
procedure TCocoaTableListView.mouseDown(event: NSEvent);