Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

[MacPlatform] Add JumpList MenuItems #9430

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions main/src/addins/MacPlatform/MacPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,24 @@ void AppDelegate_ShowDockMenu (object sender, ShowDockMenuArgs e)
newInstanceMenuItem.Title = GettextCatalog.GetString ("New Instance");
newInstanceMenuItem.Activated += NewInstanceMenuItem_Activated;
menu.AddItem (newInstanceMenuItem);

// Jump List
var projects = IdeServices.DesktopService.RecentFiles.GetProjects ().Take (10);
if (projects.Any ()) {
menu.AddItem (NSMenuItem.SeparatorItem);

foreach (var item in projects) {
var projectItem = item;

var menuItem = new NSMenuItem (projectItem.DisplayName);
menuItem.Activated += (o, e) => {
var actionUrl = "project://" + projectItem.FileName;
Ide.WelcomePage.WelcomePageSection.DispatchLink (actionUrl);
};
menu.AddItem (menuItem);
}
}

e.DockMenu = menu;
}

Expand Down