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

Commit

Permalink
[MacPlatform] Add JumpList MenuItems
Browse files Browse the repository at this point in the history
  • Loading branch information
CartBlanche committed Dec 5, 2019
1 parent 94332cf commit 1af68cc
Showing 1 changed file with 18 additions and 0 deletions.
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

0 comments on commit 1af68cc

Please sign in to comment.