From ec838cfc110662975bb12376073c1c5856b350d0 Mon Sep 17 00:00:00 2001 From: Raghav Bhutra <66239141+bhutraraghav@users.noreply.github.com> Date: Thu, 23 Jul 2020 07:52:01 +0530 Subject: [PATCH] docs: add Documentation for Open Recent Menu-item (#24374) --- docs/tutorial/recent-documents.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/tutorial/recent-documents.md b/docs/tutorial/recent-documents.md index 2bb35d94102..db5162b1267 100644 --- a/docs/tutorial/recent-documents.md +++ b/docs/tutorial/recent-documents.md @@ -39,6 +39,29 @@ will be started with the path of the file added as a command line argument. ## macOS Notes +### Adding the Recent Documents list to the application menu: + +![macOS Recent Documents menu item][menu-item-image] + +You can add menu items to access and clear recent documents by adding the following code snippet to your menu's template. + +```javascript +{ + "submenu":[ + { + "label":"Open Recent", + "role":"recentdocuments", + "submenu":[ + { + "label":"Clear Recent", + "role":"clearrecentdocuments" + } + ] + } + ] +} +``` + When a file is requested from the recent documents menu, the `open-file` event of `app` module will be emitted for it. @@ -47,3 +70,4 @@ of `app` module will be emitted for it. [addrecentdocument]: ../api/app.md#appaddrecentdocumentpath-macos-windows [clearrecentdocuments]: ../api/app.md#appclearrecentdocuments-macos-windows [app-registration]: https://msdn.microsoft.com/en-us/library/cc144104(VS.85).aspx +[menu-item-image]: https://user-images.githubusercontent.com/3168941/33003655-ea601c3a-cd70-11e7-97fa-7c062149cfb1.png