Cocoa/Config: turn ToggleBox Config to the new Style

This commit is contained in:
rich2014 2024-08-21 22:34:48 +08:00
parent f90c864215
commit 8f495aed95
3 changed files with 15 additions and 4 deletions

View File

@ -87,9 +87,15 @@ var
// min height for the Knob of VerticalScroller
// min width for the Knob of HorizontalScroller
minSize: 25;
)
);
);
);
var
CocoaConfigToggleBox: TCocoaConfigToggleBox = (
bezelStyle: NSRoundedBezelStyle;
buttonType: NSPushOnPushOffButton;
);
var
CocoaConfigNotification: TCocoaConfigNotification = (

View File

@ -138,6 +138,12 @@ type
overlay: TCocoaConfigScrollerOverlay;
end;
type
TCocoaConfigToggleBox = record
bezelStyle: NSBezelStyle;
buttonType: NSButtonType;
end;
type
TCocoaConfigNotification = record
alwaysPresent: Boolean;
@ -174,8 +180,6 @@ var
// 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
CocoaIconUse: Boolean = false;
CocoaToggleBezel : NSBezelStyle = NSRoundedBezelStyle;
CocoaToggleType : NSButtonType = NSPushOnPushOffButton;
CocoaHideFocusNoBorder : Boolean = true;

View File

@ -2275,7 +2275,8 @@ var
btn: NSButton;
cl: NSButtonCell;
begin
btn := AllocButton(AWinControl, TLCLCheckBoxCallback, AParams, CocoaToggleBezel, CocoaToggleType);
btn := AllocButton(AWinControl, TLCLCheckBoxCallback, AParams,
CocoaConfigToggleBox.bezelStyle, CocoaConfigToggleBox.buttonType);
cl := NSButtonCell(NSButton(btn).cell);
cl.setShowsStateBy(cl.showsStateBy or NSContentsCellMask);
Result := TLCLHandle(btn);