T21a: Documents, editing
- markdown read with pulldown-cmark: marks for live styling, blocks, links, words - forms::Highlight gains weight, slant and strike; measure and paint share runs - Inter Italic embedded, so emphasis reads slanted - forms::mention's popup and keys become Suggestions, shared with the editors - RichTextEditor with FixedFormatToolbar, the floating toolbar, LinkEditor, @ and : suggestions, WordCount and ReadingTime - MarkdownEditor: visual (a pressed block opens as source), source, split - BlockEditor: prose, lists, to-dos, quotes, callouts, toggles, code, math, diagrams the app draws, dividers, tables that grow and merge, pictures to resize and align, cards for video and pages, columns, synced text; slash menu, markdown shortcuts, handles that drag and open a menu, one undo for all - TodoItem and Checklist - icons: heading-1..3, workflow, merge - gallery: the Documents page with scripted states
This commit is contained in:
46 files changed
+5635
-193
No files matched your search
@@ -0,0 +1,24 @@
|
||||
use gpui::{FontWeight, Hsla};
|
||||
|
||||
/// Styles a span of the text: its color, an optional wash behind it, and its weight, slant and strike.
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub struct Highlight {
|
||||
pub color: Hsla,
|
||||
pub background: Option<Hsla>,
|
||||
pub weight: Option<FontWeight>,
|
||||
pub italic: bool,
|
||||
pub strike: bool,
|
||||
}
|
||||
|
||||
impl Highlight {
|
||||
/// A span in `color`, its font as the field's.
|
||||
pub fn new(color: Hsla) -> Self {
|
||||
Self {
|
||||
color,
|
||||
background: None,
|
||||
weight: None,
|
||||
italic: false,
|
||||
strike: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user