mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 21:39:21 +02:00
cocoa: Fixes bug #32042, adds support for custom apple menu
git-svn-id: trunk@55837 -
This commit is contained in:
parent
538f648aec
commit
0a739a97c9
@ -204,15 +204,21 @@ end;
|
||||
// For when there is a menu item with title
|
||||
procedure TCocoaMenu.overrideAppleMenu(AItem: TCocoaMenuItem);
|
||||
begin
|
||||
Self.removeItem(appleMenu);
|
||||
appleMenu.release;
|
||||
appleMenu := AItem;
|
||||
if appleMenu <> nil then
|
||||
begin
|
||||
if indexOfItem(appleMenu) >= 0 then
|
||||
removeItem(appleMenu);
|
||||
appleMenu.release;
|
||||
appleMenu := nil;
|
||||
end;
|
||||
attachedAppleMenu := False;
|
||||
AItem.attachAppleMenuItems();
|
||||
end;
|
||||
|
||||
procedure TCocoaMenu.attachAppleMenu();
|
||||
begin
|
||||
if attachedAppleMenu then Exit;
|
||||
if appleMenu = nil then Exit;
|
||||
attachedAppleMenu := True;
|
||||
insertItem_atIndex(appleMenu, 0);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user