Move set_menus method to MutableAppContext
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
41358f34e3
commit
86c0f41c9e
2 changed files with 5 additions and 5 deletions
|
@ -191,10 +191,6 @@ impl App {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_menus(&self, menus: Vec<Menu>) {
|
|
||||||
self.0.borrow().platform.set_menus(menus);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn run<F>(self, on_finish_launching: F)
|
pub fn run<F>(self, on_finish_launching: F)
|
||||||
where
|
where
|
||||||
F: 'static + FnOnce(&mut MutableAppContext),
|
F: 'static + FnOnce(&mut MutableAppContext),
|
||||||
|
@ -567,6 +563,10 @@ impl MutableAppContext {
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_menus(&self, menus: Vec<Menu>) {
|
||||||
|
self.platform.set_menus(menus);
|
||||||
|
}
|
||||||
|
|
||||||
pub fn dispatch_action<T: 'static + Any>(
|
pub fn dispatch_action<T: 'static + Any>(
|
||||||
&mut self,
|
&mut self,
|
||||||
window_id: usize,
|
window_id: usize,
|
||||||
|
|
|
@ -12,8 +12,8 @@ fn main() {
|
||||||
|
|
||||||
let app = gpui::App::new(assets::Assets).unwrap();
|
let app = gpui::App::new(assets::Assets).unwrap();
|
||||||
let (_, settings_rx) = settings::channel(&app.font_cache()).unwrap();
|
let (_, settings_rx) = settings::channel(&app.font_cache()).unwrap();
|
||||||
app.set_menus(menus::menus(settings_rx.clone()));
|
|
||||||
app.run(move |ctx| {
|
app.run(move |ctx| {
|
||||||
|
ctx.set_menus(menus::menus(settings_rx.clone()));
|
||||||
workspace::init(ctx);
|
workspace::init(ctx);
|
||||||
editor::init(ctx);
|
editor::init(ctx);
|
||||||
file_finder::init(ctx);
|
file_finder::init(ctx);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue