Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions crates/boot/src/menu/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ pub type Glyph = [u8; GLYPH_SIZE];
/// Three dots, which are drawn where a title is cut off.
pub const ELLIPSIS: Glyph = [0x00, 0x00, 0x00, 0x00, 0x00, 0xDB, 0xDB, 0x00];

/// A heart, which is drawn next to the selected entry.
pub const HEART: Glyph = [0x00, 0x66, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18];

/// The glyphs for the printable ASCII characters from space to tilde.
/// This is the public domain 8x8 font that is commonly used by hobby operating systems.
const GLYPHS: [Glyph; 95] = [
Expand Down
20 changes: 6 additions & 14 deletions crates/boot/src/menu/graphical.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::entries::BootableEntry;
use crate::menu::font::{self, ELLIPSIS, GLYPH_SIZE, Glyph, HEART};
use crate::menu::font::{self, ELLIPSIS, GLYPH_SIZE, Glyph};
use crate::menu::logo::{LOGO, LOGO_HEIGHT, LOGO_WIDTH};
use crate::menu::{BootMenu, wait_for_events};
use alloc::format;
Expand Down Expand Up @@ -52,7 +52,7 @@ const PANEL_EDGE: BltPixel = BltPixel::new(0x4a, 0x2e, 0x66);
/// The color of the pill behind the selected entry, taken from the Sprout logo.
const PILL_SELECTED: BltPixel = BltPixel::new(0xff, 0x7a, 0xb8);

/// The color of the title and the heart.
/// The color of the title.
const ACCENT: BltPixel = BltPixel::new(0xff, 0xa6, 0xd0);

/// The color of entries that aren't selected.
Expand Down Expand Up @@ -265,10 +265,10 @@ impl Layout {
.max()
.unwrap_or(0);
let status = HINT.len().max(HINT_MOUSE.len()).max(STATUS_WIDEST.len());
let panel_width = ((longest + 4) * cell + padding * 2)
let panel_width = ((longest + 3) * cell + padding * 2)
.max(40 * cell)
.max((status + 8) * cell)
.min(width.saturating_sub(margin * 2).min(width * 3 / 5));
.min(width.saturating_sub(margin * 2).min(width * 4 / 5));

// The header is as tall as the logo, and the logo needs room to bounce.
let fit = |logo: usize| {
Expand Down Expand Up @@ -322,8 +322,8 @@ impl Layout {
visible,
panel: (panel_x, panel_y, panel_width, panel_height),
radius: cell,
text_x: panel_x + padding + cell * 3,
columns: list_width.saturating_sub(cell * 4) / cell,
text_x: panel_x + padding + cell,
columns: list_width.saturating_sub(cell * 2) / cell,
footer: list_y + list + cell,
logo: (group_x, top + bounce, logo_width, logo_height),
bounce,
Expand Down Expand Up @@ -712,14 +712,6 @@ fn render(
layout.height,
PILL_SELECTED,
);
draw_glyph(
fb,
layout.x + layout.cell,
text_row,
layout.scale,
&HEART,
TEXT_SELECTED,
);
TEXT_SELECTED
} else {
TEXT
Expand Down
Loading