Add "Reset Zoom" action and application menu item
This commit is contained in:
@@ -164,6 +164,10 @@ pub fn menus() -> Vec<Menu<'static>> {
|
||||
name: "Zoom Out",
|
||||
action: Box::new(super::DecreaseBufferFontSize),
|
||||
},
|
||||
MenuItem::Action {
|
||||
name: "Reset Zoom",
|
||||
action: Box::new(super::ResetBufferFontSize),
|
||||
},
|
||||
MenuItem::Separator,
|
||||
MenuItem::Action {
|
||||
name: "Project Browser",
|
||||
|
||||
@@ -43,6 +43,7 @@ actions!(
|
||||
OpenKeymap,
|
||||
IncreaseBufferFontSize,
|
||||
DecreaseBufferFontSize,
|
||||
ResetBufferFontSize,
|
||||
InstallCommandLineInterface,
|
||||
]
|
||||
);
|
||||
@@ -72,6 +73,12 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut gpui::MutableAppContext) {
|
||||
cx.refresh_windows();
|
||||
});
|
||||
});
|
||||
cx.add_global_action(move |_: &ResetBufferFontSize, cx| {
|
||||
cx.update_global::<Settings, _, _>(|settings, cx| {
|
||||
settings.buffer_font_size = settings.default_buffer_font_size;
|
||||
cx.refresh_windows();
|
||||
});
|
||||
});
|
||||
cx.add_global_action(move |_: &InstallCommandLineInterface, cx| {
|
||||
cx.spawn(|cx| async move { install_cli(&cx).await.context("error creating CLI symlink") })
|
||||
.detach_and_log_err(cx);
|
||||
|
||||
Reference in New Issue
Block a user