Skip to content

v0.2.11

Choose a tag to compare

@clearloop clearloop released this 10 Oct 12:32
· 13 commits to main since this release
4238b03

Theme families from TOML, terminal colours and the frost tone as palette tokens, palette builders that capture, #fragment links that jump to their heading, a combobox row leading, cards set in the document's body face, and Home and End by painted row in wrapped text.

New

  • Theme::vibrancy_tone is the frost's tint at full coverage, so a palette sets the colour of a translucent window and a brand tints it.
  • Combobox::with_leading draws an element before each row's label in the menu, such as a swatch or an icon.
  • ThemeFamily deserializes a theme family, TOML or any serde format: a name and a dark and a light Variant, each a set of colour tokens laid over the shipped palette for its appearance, where a nested table like [dark.syntax] names syntax.* tokens. Theme::tokens_mut names every token a file can set.
  • Theme::terminal_bg and Theme::terminal_ansi hold the terminal's background and its 16 named ANSI colours, so a palette sets them like any other token and a brand tints their greys.
  • A #fragment link in markdown jumps to the heading it names, matched as GitHub slugs headings, through Editing::jump and an OnJump. markdown::link::slug and heading resolve one.
  • Editor::select_to_top selects and scrolls the caret's row to the top of the scroll box; the editor jumps to a #fragment link's heading with it.
  • BlockLayouts::row_start, row_end and wraps_at give the painted row around a position.

Changed

  • AppExt::set_palette takes any Fn(Appearance) -> Theme + 'static, so a builder can capture what it builds from.
  • TextInk::paint sets the text roles' alphas over the colour the palette's text carries instead of over white or black, so a palette with its own text colour keeps it under a brand.
  • terminal::view::indexed_color resolves an indexed colour against a theme, and extended_rgb gives indexes 16-255. terminal_bg_for, terminal_bg and indexed_rgb are gone.
  • Selection::affinity names the row a caret at a soft wrap paints on. BlockLayouts::position takes an Affinity, hit answers with one, and step_row takes one and a column instead of a point. Selection built field by field needs the new field; Selection::new sets it.

Fixed

  • Cards, bands and captions inside a markdown document are set in Theme::font_body like its text, instead of the interface face, unless they name their own.
  • Home and End in a wrapped paragraph go to the edges of the painted row instead of the block, End's caret stays on its row, and Left and Right at a soft wrap first cross to the other row without moving.