Fix or promote leftover TODOs and GPUI APIs (#12514)

fixes https://github.com/zed-industries/zed/issues/11966

Release Notes:

- N/A
This commit is contained in:
Mikayla Maki 2024-05-31 18:36:15 -07:00 committed by GitHub
parent a6e0c8aca1
commit 94c3101fb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 581 additions and 441 deletions

View file

@ -29,10 +29,11 @@ use crate::{
current_platform, init_app_menus, Action, ActionRegistry, Any, AnyView, AnyWindowHandle,
AppMetadata, AssetCache, AssetSource, BackgroundExecutor, ClipboardItem, Context,
DispatchPhase, DisplayId, Entity, EventEmitter, ForegroundExecutor, Global, KeyBinding, Keymap,
Keystroke, LayoutId, Menu, MenuItem, PathPromptOptions, Pixels, Platform, PlatformDisplay,
Point, PromptBuilder, PromptHandle, PromptLevel, Render, RenderablePromptHandle, Reservation,
SharedString, SubscriberSet, Subscription, SvgRenderer, Task, TextSystem, View, ViewContext,
Window, WindowAppearance, WindowContext, WindowHandle, WindowId,
Keystroke, LayoutId, Menu, MenuItem, OwnedMenu, PathPromptOptions, Pixels, Platform,
PlatformDisplay, Point, PromptBuilder, PromptHandle, PromptLevel, Render,
RenderablePromptHandle, Reservation, SharedString, SubscriberSet, Subscription, SvgRenderer,
Task, TextSystem, View, ViewContext, Window, WindowAppearance, WindowContext, WindowHandle,
WindowId,
};
mod async_context;
@ -1167,6 +1168,11 @@ impl AppContext {
self.platform.set_menus(menus, &self.keymap.borrow());
}
/// Sets the menu bar for this application. This will replace any existing menu bar.
pub fn get_menus(&self) -> Option<Vec<OwnedMenu>> {
self.platform.get_menus()
}
/// Sets the right click menu for the app icon in the dock
pub fn set_dock_menu(&mut self, menus: Vec<MenuItem>) {
self.platform.set_dock_menu(menus, &self.keymap.borrow());