mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: improve the way that 'Go' menu icons are setup to be compatible with macOS 14+
This commit is contained in:
parent
6396d2e625
commit
b8ec3221fd
1 changed files with 27 additions and 19 deletions
|
|
@ -111,13 +111,12 @@ const
|
|||
COMMON_FOLDERS: TStringArray = (
|
||||
'~/Documents',
|
||||
'~/Desktop',
|
||||
'~/Downloads',
|
||||
'~',
|
||||
'~/Pictures',
|
||||
'~/Movies',
|
||||
'~/Music',
|
||||
'/Applications/Utilities',
|
||||
|
||||
'~/Downloads',
|
||||
'~/Library',
|
||||
'/Applications',
|
||||
|
||||
|
|
@ -222,33 +221,42 @@ var
|
|||
menu: TMenuItem;
|
||||
tag: PtrInt = 0;
|
||||
|
||||
function newItem( caption: String ): TMenuItem;
|
||||
procedure newItem( imageName: String );
|
||||
var
|
||||
folderName: String;
|
||||
lclItem: TMenuItem;
|
||||
cocoaItem: NSMenuItem;
|
||||
cocoaImage: NSImage;
|
||||
begin
|
||||
folderName:= getMacOSDisplayNameFromPath( COMMON_FOLDERS[tag] );
|
||||
Result:= TMenuItem.Create( menu );
|
||||
Result.Caption:= caption + ' ' + folderName;
|
||||
Result.onClick:= @toolBarMenuHandler.goToFolder;
|
||||
Result.Tag:= tag;
|
||||
lclItem:= TMenuItem.Create( menu );
|
||||
lclItem.Caption:= folderName;
|
||||
lclItem.onClick:= @toolBarMenuHandler.goToFolder;
|
||||
lclItem.Tag:= tag;
|
||||
menu.Add( lclItem );
|
||||
|
||||
cocoaImage:= NSImage.imageWithSystemSymbolName_accessibilityDescription(
|
||||
NSSTR(imageName), nil );
|
||||
cocoaItem:= NSMenuItem( lclItem.Handle );
|
||||
cocoaItem.setImage( cocoaImage );
|
||||
|
||||
inc( tag );
|
||||
end;
|
||||
|
||||
begin
|
||||
menu:= TMenuItem.Create( frmMain );
|
||||
menu.Add( newItem('') );
|
||||
menu.Add( newItem('') );
|
||||
menu.Add( newItem('') );
|
||||
menu.Add( newItem('') );
|
||||
menu.Add( newItem('') );
|
||||
menu.Add( newItem('') );
|
||||
menu.Add( newItem('') );
|
||||
newItem('doc');
|
||||
newItem('menubar.dock.rectangle');
|
||||
newItem('arrow.down.circle');
|
||||
newItem('house');
|
||||
newItem('photo');
|
||||
newItem('film');
|
||||
newItem('music.quarternote.3');
|
||||
newItem('wrench.and.screwdriver.fill');
|
||||
newItem('l.circle');
|
||||
newItem('a.circle');
|
||||
menu.AddSeparator;
|
||||
menu.Add( newItem(' ') );
|
||||
menu.Add( newItem(' ') );
|
||||
menu.Add( newItem(' ') );
|
||||
menu.AddSeparator;
|
||||
menu.Add( newItem(' ') );
|
||||
newItem('trash');
|
||||
Result:= menu;
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue