cocoa: hidding the text title for ownerdrawn controls

This commit is contained in:
Dmitry Boyarintsev 2021-10-02 00:23:39 -04:00 committed by Maxim Ganetsky
parent 26930d85c6
commit 49bb85a7ba

View File

@ -1643,9 +1643,24 @@ var
r : NSRect;
rr : NSRect;
dr : TRect;
t : NSString;
begin
if isOwnerDrawn then
begin
t := title;
if Assigned(t) then t.retain;
setTitle(NSString.string_);
end else
t := nil;
inherited drawRect(dirtyRect);
if Assigned(t) then
begin
setTitle(t);
t.release;
end;
// if ownerDrawn style, then need to call "DrawItem" event
if isOwnerDrawn and Assigned(callback)
and (lastSelectedItemIndex>=0) and (lastSelectedItemIndex<list.Count)