mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 20:59:08 +02:00
Upd: Cocoa: Left/Right Arrow improved in TabControl
This commit is contained in:
parent
b64bc6bef8
commit
8abb468491
@ -160,23 +160,21 @@ end;
|
|||||||
function AllocArrowButton(isPrev: Boolean): NSButton;
|
function AllocArrowButton(isPrev: Boolean): NSButton;
|
||||||
var
|
var
|
||||||
btn : NSButton;
|
btn : NSButton;
|
||||||
r : NSRect;
|
|
||||||
begin
|
begin
|
||||||
btn:=NSButton(NSButton.alloc).initWithFrame(NSZeroRect);
|
btn:=NSButton(NSButton.alloc).initWithFrame(NSZeroRect);
|
||||||
btn.setBezelStyle(NSRegularSquareBezelStyle);
|
btn.setBezelStyle(NSRegularSquareBezelStyle);
|
||||||
btn.setButtonType(NSMomentaryLightButton);
|
btn.setButtonType(NSMomentaryLightButton);
|
||||||
|
|
||||||
if isPrev then
|
if isPrev then
|
||||||
btn.setImage( NSImage.imageNamed( NSImageNameLeftFacingTriangleTemplate ))
|
btn.setTitle( StrToNSString('◀') )
|
||||||
else
|
else
|
||||||
btn.setImage( NSImage.imageNamed( NSImageNameRightFacingTriangleTemplate ));
|
btn.setTitle( StrToNSString('▶') );
|
||||||
|
|
||||||
{$ifdef BOOLFIX}
|
{$ifdef BOOLFIX}
|
||||||
btn.setBordered_(Ord(false));
|
btn.setBordered_(Ord(false));
|
||||||
{$else}
|
{$else}
|
||||||
btn.setBordered(false);
|
btn.setBordered(false);
|
||||||
{$endif}
|
{$endif}
|
||||||
btn.setTitle(NSString.string_);
|
|
||||||
btn.sizeToFit();
|
btn.sizeToFit();
|
||||||
if not isPrev then btn.setAutoresizingMask(NSViewMinXMargin);
|
if not isPrev then btn.setAutoresizingMask(NSViewMinXMargin);
|
||||||
Result:=btn;
|
Result:=btn;
|
||||||
@ -184,7 +182,7 @@ end;
|
|||||||
|
|
||||||
const
|
const
|
||||||
arrow_hofs = 12;
|
arrow_hofs = 12;
|
||||||
arrow_vofs = 20;
|
arrow_vofs = 10;
|
||||||
|
|
||||||
procedure PlaceButton(isPrev: Boolean; abtn: NSButton; dst: NSTabView);
|
procedure PlaceButton(isPrev: Boolean; abtn: NSButton; dst: NSTabView);
|
||||||
var
|
var
|
||||||
|
Loading…
Reference in New Issue
Block a user