mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 07:30:19 +02:00
cocoa: themedrawing swithcing the current graphic context
git-svn-id: trunk@58766 -
This commit is contained in:
parent
98812def35
commit
a78e37d9b2
@ -180,18 +180,26 @@ var
|
||||
acc : TCocoaContextAccess;
|
||||
nsr : NSRect;
|
||||
dr : NSRect;
|
||||
|
||||
cur : NSGraphicsContext;
|
||||
begin
|
||||
cl := GetCellForDetails(Details);
|
||||
if Assigned(cl) then
|
||||
begin
|
||||
acc := TCocoaContextAccess(DC);
|
||||
|
||||
cur := NSGraphicsContext.currentContext;
|
||||
NSGraphicsContext.setCurrentContext( acc.ctx );
|
||||
|
||||
acc.SetCGFillping(acc.CGContext, 0, -acc.Size.cy);
|
||||
try
|
||||
LCLToNSRect( R, acc.size.cy, dr);
|
||||
cl.drawWithFrame_inView (dr, nil );
|
||||
finally
|
||||
acc.SetCGFillping(acc.CGContext, 0, -acc.Size.cy);
|
||||
NSGraphicsContext.setCurrentContext( cur );
|
||||
end;
|
||||
|
||||
Exit;
|
||||
end;
|
||||
|
||||
@ -399,6 +407,8 @@ begin
|
||||
lBrush := TCocoaBrush.Create(lColor, False);
|
||||
DC.Rectangle(R.Left, R.Top, R.Right, R.Bottom, True, lBrush);
|
||||
lBrush.Free;
|
||||
|
||||
Result := R;
|
||||
end;
|
||||
TVP_GLYPH, TVP_HOTGLYPH:
|
||||
begin
|
||||
@ -463,6 +473,8 @@ begin
|
||||
Result := R;
|
||||
{$endif}
|
||||
end;
|
||||
else
|
||||
Result := Bounds(0,0,0,0);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user