Add ResetAllZoom and ResetAgentZoom actions (#41124)
Very often, when I'm testing or playing around with the zoom feature, including the agent panel, I find myself missing one quick action that would bring everything back to normal. That's what `ResetAllZoom` does. If you have customized your zoom level in all areas of Zed, that action returns everything to its default state. Similarly, if you're playing around with zoom just in the agent panel, `ResetAgentZoom` does the same in that context. Release Notes: - Added the `ResetAllZoom` and `ResetAgentZoom ` actions, allowing to return the zoom level across the whole app and/or just in the agent panel to its default/original value.
This commit is contained in:
@@ -870,6 +870,24 @@ fn register_actions(
|
||||
}
|
||||
}
|
||||
})
|
||||
.register_action({
|
||||
let fs = app_state.fs.clone();
|
||||
move |_, action: &zed_actions::ResetAllZoom, _window, cx| {
|
||||
if action.persist {
|
||||
update_settings_file(fs.clone(), cx, move |settings, _| {
|
||||
settings.theme.ui_font_size = None;
|
||||
settings.theme.buffer_font_size = None;
|
||||
settings.theme.agent_ui_font_size = None;
|
||||
settings.theme.agent_buffer_font_size = None;
|
||||
});
|
||||
} else {
|
||||
theme::reset_ui_font_size(cx);
|
||||
theme::reset_buffer_font_size(cx);
|
||||
theme::reset_agent_ui_font_size(cx);
|
||||
theme::reset_agent_buffer_font_size(cx);
|
||||
}
|
||||
}
|
||||
})
|
||||
.register_action(|_, _: &install_cli::RegisterZedScheme, window, cx| {
|
||||
cx.spawn_in(window, async move |workspace, cx| {
|
||||
install_cli::register_zed_scheme(cx).await?;
|
||||
|
||||
@@ -20,6 +20,10 @@ pub fn app_menus(cx: &mut App) -> Vec<Menu> {
|
||||
"Reset Zoom",
|
||||
zed_actions::ResetBufferFontSize { persist: false },
|
||||
),
|
||||
MenuItem::action(
|
||||
"Reset All Zoom",
|
||||
zed_actions::ResetAllZoom { persist: false },
|
||||
),
|
||||
MenuItem::separator(),
|
||||
MenuItem::action("Toggle Left Dock", workspace::ToggleLeftDock),
|
||||
MenuItem::action("Toggle Right Dock", workspace::ToggleRightDock),
|
||||
|
||||
Reference in New Issue
Block a user