aboutsummaryrefslogtreecommitdiff
path: root/src/text.rs
diff options
context:
space:
mode:
authorPolesznyák Márk <contact@pml68.dev>2025-10-19 12:17:01 +0200
committerPolesznyák Márk <contact@pml68.dev>2025-10-19 12:17:01 +0200
commit7d3bacc69df0ba1151836c8da40bace5dfc5f037 (patch)
tree1f0d531f3810b32a8b5ab6e6d63f856b98c51931 /src/text.rs
parentfeat: initial commit (diff)
downloadiced_selection-7d3bacc69df0ba1151836c8da40bace5dfc5f037.tar.gz
feat: add selectable `Rich` widget with an example
Diffstat (limited to 'src/text.rs')
-rw-r--r--src/text.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/text.rs b/src/text.rs
index 96d4f1b..07ced03 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -1,7 +1,6 @@
//! Text widgets display information through writing.
mod rich;
-pub use iced_widget::text::Rich;
use iced_widget::{
core::{
self, Color, Element, Event, Font, Layout, Length, Pixels, Point, Size,
@@ -20,7 +19,9 @@ use iced_widget::{
},
graphics::text::Paragraph,
};
+pub use rich::Rich;
use text::{Alignment, LineHeight, Shaping, Wrapping};
+pub use text::{Fragment, Highlighter, IntoFragment, Span};
use crate::selection::{Selection, SelectionEnd};
@@ -33,7 +34,7 @@ pub struct Text<
Theme: Catalog,
Renderer: text::Renderer,
{
- fragment: text::Fragment<'a>,
+ fragment: Fragment<'a>,
format: Format<Renderer::Font>,
class: Theme::Class<'a>,
}
@@ -44,7 +45,7 @@ where
Renderer: text::Renderer,
{
/// Create a new fragment of [`Text`] with the given contents.
- pub fn new(fragment: impl text::IntoFragment<'a>) -> Self {
+ pub fn new(fragment: impl IntoFragment<'a>) -> Self {
Self {
fragment: fragment.into_fragment(),
format: Format::default(),