Adjust terminal line spacing and distinguish active pane titles
This commit is contained in:
@@ -288,9 +288,10 @@ Neovide's MIT license and both sources are recorded in
|
||||
[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|
||||
|
||||
Font preference is Hermit (including Hurmit Nerd Font variants), SF Mono,
|
||||
Noto Sans Mono, Iosevka, then another verified fixed-pitch family. Text uses
|
||||
15 logical pixels with a 20-pixel line height by default. The text-size shortcuts
|
||||
resize all terminals in the focused window, including panes opened there later.
|
||||
Noto Sans Mono, Iosevka, then another verified fixed-pitch family. The default
|
||||
font size is 15 logical pixels. Row height scales with font size and rounds to
|
||||
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
|
||||
colors, truecolor, bold/italic/dim, underline, reverse video, wide characters,
|
||||
and combining marks. Alacritty supplies terminal modes and 10,000 lines of
|
||||
|
||||
+26
-1
@@ -25,11 +25,36 @@ pub const MUTED: u32 = 0xa29fbc;
|
||||
pub const ACCENT: u32 = 0x9858f9;
|
||||
// Huayra's Sybil green: hsl(163 72% 45%).
|
||||
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 CONTENT_INSET: f32 = 8.;
|
||||
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 id: u64,
|
||||
pub label: SharedString,
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ impl TerminalFont {
|
||||
face,
|
||||
size,
|
||||
cell_width,
|
||||
line_height: (size * 4. / 3.).round(),
|
||||
line_height: (size * 1.8).round(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-28
@@ -759,23 +759,12 @@ fn stack_headers(entries: &[StackPaneInfo], id: String, client: Option<&Client>)
|
||||
let pane = entry.id;
|
||||
let client = client.cloned();
|
||||
headers = headers.child(
|
||||
div()
|
||||
chrome::pane_title_bar(false)
|
||||
.id(ElementId::Name(format!("collapsed-pane-{pane}").into()))
|
||||
.h(px(28.))
|
||||
.flex_shrink_0()
|
||||
.px(px(9.))
|
||||
.border_1()
|
||||
.border_color(rgb(chrome::BORDER))
|
||||
.bg(rgb(chrome::TERMINAL_BACKGROUND))
|
||||
.font_family(".SystemUIFont")
|
||||
.text_size(px(11.))
|
||||
.text_color(rgb(chrome::PANE_MUTED))
|
||||
.border_color(rgb(chrome::PANE_INACTIVE_BORDER))
|
||||
.cursor_pointer()
|
||||
.hover(|style| {
|
||||
style
|
||||
.bg(rgb(chrome::HOVER_BACKGROUND))
|
||||
.text_color(rgb(chrome::PANE_FOCUS))
|
||||
})
|
||||
.hover(|style| style.border_color(rgb(0xbdbdbd)))
|
||||
.on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation())
|
||||
.on_click(move |_, _, cx| {
|
||||
cx.stop_propagation();
|
||||
@@ -947,21 +936,10 @@ impl TerminalPane {
|
||||
}
|
||||
|
||||
fn pane_header(&mut self, cx: &mut Context<Self>) -> Div {
|
||||
let mut header = div()
|
||||
let mut header = chrome::pane_title_bar(self.active)
|
||||
.flex()
|
||||
.items_center()
|
||||
.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(
|
||||
MouseButton::Left,
|
||||
cx.listener(|pane, _, window, cx| {
|
||||
@@ -983,7 +961,8 @@ impl TerminalPane {
|
||||
.child(
|
||||
div()
|
||||
.flex_shrink_0()
|
||||
.text_color(rgb(chrome::MUTED))
|
||||
.text_size(px(11.))
|
||||
.font_weight(FontWeight::NORMAL)
|
||||
.child("Enter to save · Esc to cancel"),
|
||||
);
|
||||
} else {
|
||||
@@ -1308,7 +1287,7 @@ impl Render for TerminalPane {
|
||||
.border_color(rgb(if self.active {
|
||||
chrome::PANE_FOCUS
|
||||
} else {
|
||||
chrome::BORDER
|
||||
chrome::PANE_INACTIVE_BORDER
|
||||
}))
|
||||
.overflow_hidden()
|
||||
.track_focus(&self.focus)
|
||||
|
||||
Reference in New Issue
Block a user