summaryrefslogtreecommitdiffstats
path: root/core/src/text
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-17 22:04:11 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-17 22:04:11 +0200
commit910eb72a0620b34e5b3d7793bbd5ab7290e08dd6 (patch)
tree0a0940d56a9bc4147b7ef06fe9fb5099c761090a /core/src/text
parentffb520fb3703ce4ece9fb6d5ee2c7aa0b846879f (diff)
downloadiced-910eb72a0620b34e5b3d7793bbd5ab7290e08dd6.tar.gz
iced-910eb72a0620b34e5b3d7793bbd5ab7290e08dd6.tar.bz2
iced-910eb72a0620b34e5b3d7793bbd5ab7290e08dd6.zip
Implement `rich_text` widget and `markdown` example
Diffstat (limited to 'core/src/text')
-rw-r--r--core/src/text/paragraph.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/text/paragraph.rs b/core/src/text/paragraph.rs
index 66cadb5c..4ee83798 100644
--- a/core/src/text/paragraph.rs
+++ b/core/src/text/paragraph.rs
@@ -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);