Fill context menu of Zed macOS dock icon with recent projects (#8952)
Fixes https://github.com/zed-industries/zed/issues/8416 Release Notes: - Added recent projects into Zed's macOS dock icon context menu ([8416](https://github.com/zed-industries/zed/issues/8416)) --------- Co-authored-by: Kirill Bulatov <kirill@zed.dev>
This commit is contained in:
parent
5bf0c8ed2d
commit
cb16003133
9 changed files with 121 additions and 23 deletions
|
@ -1132,6 +1132,17 @@ impl AppContext {
|
|||
self.platform.set_menus(menus, &self.keymap.borrow());
|
||||
}
|
||||
|
||||
/// Adds given path to list of recent paths for the application.
|
||||
/// The list is usually shown on the application icon's context menu in the dock,
|
||||
/// and allows to open the recent files via that context menu.
|
||||
pub fn add_recent_documents(&mut self, paths: &[PathBuf]) {
|
||||
self.platform.add_recent_documents(paths);
|
||||
}
|
||||
|
||||
/// Clears the list of recent paths from the application.
|
||||
pub fn clear_recent_documents(&mut self) {
|
||||
self.platform.clear_recent_documents();
|
||||
}
|
||||
/// Dispatch an action to the currently active window or global action handler
|
||||
/// See [action::Action] for more information on how actions work
|
||||
pub fn dispatch_action(&mut self, action: &dyn Action) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue