From e4c13cf957b7515b6ab33306c59fa48305c55973 Mon Sep 17 00:00:00 2001 From: dmitry Date: Sun, 17 Nov 2019 02:37:14 +0000 Subject: [PATCH] cocoa: making togglebox consistent with the standard button. Providing configuration to make the cocoa run in backwards compatible manner git-svn-id: trunk@62250 - --- lcl/interfaces/cocoa/cocoaint.pas | 2 ++ lcl/interfaces/cocoa/cocoawsstdctrls.pas | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/cocoa/cocoaint.pas b/lcl/interfaces/cocoa/cocoaint.pas index c5c03de2a7..8b8d0db91b 100644 --- a/lcl/interfaces/cocoa/cocoaint.pas +++ b/lcl/interfaces/cocoa/cocoaint.pas @@ -242,6 +242,8 @@ 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; {$ifdef COCOALOOPHIJACK} // The flag is set to true once hi-jacked loop is finished (at the end of app) diff --git a/lcl/interfaces/cocoa/cocoawsstdctrls.pas b/lcl/interfaces/cocoa/cocoawsstdctrls.pas index 408fff5562..0460cead06 100644 --- a/lcl/interfaces/cocoa/cocoawsstdctrls.pas +++ b/lcl/interfaces/cocoa/cocoawsstdctrls.pas @@ -346,6 +346,9 @@ procedure ControlSetTextWithChangeEvent(ctrl: NSControl; const text: string); implementation +uses + CocoaInt; + const VerticalScrollerVisible: array[TScrollStyle] of boolean = ( {ssNone } false, @@ -1900,7 +1903,7 @@ var btn: NSButton; cl: NSButtonCell; begin - btn := AllocButton(AWinControl, TLCLButtonCallBack, AParams, NSTexturedRoundedBezelStyle, NSToggleButton); + btn := AllocButton(AWinControl, TLCLButtonCallBack, AParams, CocoaToggleBezel, CocoaToggleType); cl := NSButtonCell(NSButton(btn).cell); cl.setShowsStateBy(cl.showsStateBy or NSContentsCellMask); Result := TLCLIntfHandle(btn);