Allow the agent panel font size to be customized (#29954)

You can set `agent_font_size` as a top-level settings key. You can also
use `zed::IncreaseBufferFontSize` and `zed::DecreaseBufferFontSize` and
`zed::ResetBufferFontSize` the agent panel is focused via the standard
bindings to adjust the agent font size. In the future, it might make
sense to rename these actions to be more general since "buffer" is now a
bit of a misnomer. 🍐'd with @mikayla-maki

Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
This commit is contained in:
Nathan Sobo
2025-05-05 16:13:14 -06:00
committed by GitHub
co-authored by Mikayla Maki
parent 0bf682a0d5
commit 4896e0bc02
6 changed files with 310 additions and 189 deletions
+4 -2
View File
@@ -540,7 +540,6 @@ impl ToolCard for EditFileToolCard {
});
let (editor, editor_line_height) = self.editor.update(cx, |editor, cx| {
let ui_font_size = ThemeSettings::get_global(cx).ui_font_size(cx);
let line_height = editor
.style()
.map(|style| style.text.line_height_in_pixels(window.rem_size()))
@@ -558,7 +557,10 @@ impl ToolCard for EditFileToolCard {
font_family: settings.buffer_font.family.clone(),
font_features: settings.buffer_font.features.clone(),
font_fallbacks: settings.buffer_font.fallbacks.clone(),
font_size: ui_font_size.into(),
font_size: TextSize::Small
.rems(cx)
.to_pixels(settings.agent_font_size(cx))
.into(),
font_weight: settings.buffer_font.weight,
line_height: relative(settings.buffer_line_height.value()),
..Default::default()