Adjust terminal line spacing and distinguish active pane titles

This commit is contained in:
James Magahern
2026-11-17 18:12:04 -08:00
parent a8cf702d43
commit a388944d73
4 changed files with 38 additions and 33 deletions
+4 -3
View File
@@ -288,9 +288,10 @@ Neovide's MIT license and both sources are recorded in
[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
Font preference is Hermit (including Hurmit Nerd Font variants), SF Mono, Font preference is Hermit (including Hurmit Nerd Font variants), SF Mono,
Noto Sans Mono, Iosevka, then another verified fixed-pitch family. Text uses Noto Sans Mono, Iosevka, then another verified fixed-pitch family. The default
15 logical pixels with a 20-pixel line height by default. The text-size shortcuts font size is 15 logical pixels. Row height scales with font size and rounds to
resize all terminals in the focused window, including panes opened there later. the nearest logical pixel. The text-size shortcuts resize all terminals in the
focused window, including panes opened there later.
Each new window starts at the default size. Rendering supports ANSI/256 Each new window starts at the default size. Rendering supports ANSI/256
colors, truecolor, bold/italic/dim, underline, reverse video, wide characters, colors, truecolor, bold/italic/dim, underline, reverse video, wide characters,
and combining marks. Alacritty supplies terminal modes and 10,000 lines of and combining marks. Alacritty supplies terminal modes and 10,000 lines of
+26 -1
View File
@@ -25,11 +25,36 @@ pub const MUTED: u32 = 0xa29fbc;
pub const ACCENT: u32 = 0x9858f9; pub const ACCENT: u32 = 0x9858f9;
// Huayra's Sybil green: hsl(163 72% 45%). // Huayra's Sybil green: hsl(163 72% 45%).
pub const PANE_FOCUS: u32 = 0x20c597; pub const PANE_FOCUS: u32 = 0x20c597;
pub const PANE_MUTED: u32 = 0x527f73; pub const PANE_INACTIVE_BORDER: u32 = 0x646464;
pub const DANGER: u32 = 0xf26977; pub const DANGER: u32 = 0xf26977;
pub const CONTENT_INSET: f32 = 8.; pub const CONTENT_INSET: f32 = 8.;
pub const HEADER_HEIGHT: f32 = 44.; pub const HEADER_HEIGHT: f32 = 44.;
fn pane_title_gradient(active: bool) -> gpui::Background {
let (start, end) = if active {
(0x169b7b, 0x95e9cf)
} else {
(0x767676, 0xafafaf)
};
gpui::linear_gradient(
90.,
gpui::linear_color_stop(rgb(start), 0.),
gpui::linear_color_stop(rgb(end), 1.),
)
}
pub fn pane_title_bar(active: bool) -> Div {
div()
.h(px(26.))
.flex_shrink_0()
.px(px(9.))
.bg(pane_title_gradient(active))
.font_family(".SystemUIFont")
.text_size(px(12.))
.text_color(gpui::black())
.when(active, |bar| bar.font_weight(gpui::FontWeight::BOLD))
}
pub struct ChromeTab { pub struct ChromeTab {
pub id: u64, pub id: u64,
pub label: SharedString, pub label: SharedString,
+1 -1
View File
@@ -36,7 +36,7 @@ impl TerminalFont {
face, face,
size, size,
cell_width, cell_width,
line_height: (size * 4. / 3.).round(), line_height: (size * 1.8).round(),
} }
} }
+7 -28
View File
@@ -759,23 +759,12 @@ fn stack_headers(entries: &[StackPaneInfo], id: String, client: Option<&Client>)
let pane = entry.id; let pane = entry.id;
let client = client.cloned(); let client = client.cloned();
headers = headers.child( headers = headers.child(
div() chrome::pane_title_bar(false)
.id(ElementId::Name(format!("collapsed-pane-{pane}").into())) .id(ElementId::Name(format!("collapsed-pane-{pane}").into()))
.h(px(28.))
.flex_shrink_0()
.px(px(9.))
.border_1() .border_1()
.border_color(rgb(chrome::BORDER)) .border_color(rgb(chrome::PANE_INACTIVE_BORDER))
.bg(rgb(chrome::TERMINAL_BACKGROUND))
.font_family(".SystemUIFont")
.text_size(px(11.))
.text_color(rgb(chrome::PANE_MUTED))
.cursor_pointer() .cursor_pointer()
.hover(|style| { .hover(|style| style.border_color(rgb(0xbdbdbd)))
style
.bg(rgb(chrome::HOVER_BACKGROUND))
.text_color(rgb(chrome::PANE_FOCUS))
})
.on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation()) .on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation())
.on_click(move |_, _, cx| { .on_click(move |_, _, cx| {
cx.stop_propagation(); cx.stop_propagation();
@@ -947,21 +936,10 @@ impl TerminalPane {
} }
fn pane_header(&mut self, cx: &mut Context<Self>) -> Div { fn pane_header(&mut self, cx: &mut Context<Self>) -> Div {
let mut header = div() let mut header = chrome::pane_title_bar(self.active)
.flex() .flex()
.items_center() .items_center()
.gap(px(8.)) .gap(px(8.))
.h(px(28.))
.flex_shrink_0()
.px(px(9.))
.bg(rgb(chrome::TERMINAL_BACKGROUND))
.font_family(".SystemUIFont")
.text_size(px(11.))
.text_color(rgb(if self.active {
chrome::PANE_FOCUS
} else {
chrome::PANE_MUTED
}))
.on_mouse_down( .on_mouse_down(
MouseButton::Left, MouseButton::Left,
cx.listener(|pane, _, window, cx| { cx.listener(|pane, _, window, cx| {
@@ -983,7 +961,8 @@ impl TerminalPane {
.child( .child(
div() div()
.flex_shrink_0() .flex_shrink_0()
.text_color(rgb(chrome::MUTED)) .text_size(px(11.))
.font_weight(FontWeight::NORMAL)
.child("Enter to save · Esc to cancel"), .child("Enter to save · Esc to cancel"),
); );
} else { } else {
@@ -1308,7 +1287,7 @@ impl Render for TerminalPane {
.border_color(rgb(if self.active { .border_color(rgb(if self.active {
chrome::PANE_FOCUS chrome::PANE_FOCUS
} else { } else {
chrome::BORDER chrome::PANE_INACTIVE_BORDER
})) }))
.overflow_hidden() .overflow_hidden()
.track_focus(&self.focus) .track_focus(&self.focus)