Implement rich_text widget and markdown example
This commit is contained in:
parent
ffb520fb37
commit
910eb72a06
11 changed files with 787 additions and 99 deletions
|
|
@ -1,6 +1,6 @@
|
|||
//! Draw paragraphs.
|
||||
use crate::alignment;
|
||||
use crate::text::{Difference, Hit, Text};
|
||||
use crate::text::{Difference, Hit, Span, Text};
|
||||
use crate::{Point, Size};
|
||||
|
||||
/// A text paragraph.
|
||||
|
|
@ -11,6 +11,9 @@ pub trait Paragraph: Sized + Default {
|
|||
/// Creates a new [`Paragraph`] laid out with the given [`Text`].
|
||||
fn with_text(text: Text<&str, Self::Font>) -> Self;
|
||||
|
||||
/// Creates a new [`Paragraph`] laid out with the given [`Text`].
|
||||
fn with_spans(text: Text<&[Span<'_, Self::Font>], Self::Font>) -> Self;
|
||||
|
||||
/// Lays out the [`Paragraph`] with some new boundaries.
|
||||
fn resize(&mut self, new_bounds: Size);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue