@@ -13,6 +13,7 @@ use super::{
1313 TextHorizontalAlignment , TextOverflow , TextStrokeStyle , TextVerticalAlignment , TextWrap ,
1414 VoidArg , WindowItem ,
1515} ;
16+ use crate :: api;
1617use crate :: graphics:: { Brush , Color , FontRequest } ;
1718use crate :: input:: {
1819 FocusEvent , FocusEventResult , FocusReason , InputEventFilterResult , InputEventResult , KeyEvent ,
@@ -225,10 +226,10 @@ impl ComplexText {
225226#[ repr( C ) ]
226227#[ derive( FieldOffsets , Default , SlintElement ) ]
227228#[ pin]
228- pub struct MarkdownText {
229+ pub struct StyledText {
229230 pub width : Property < LogicalLength > ,
230231 pub height : Property < LogicalLength > ,
231- pub text : Property < SharedString > ,
232+ pub text : Property < api :: StyledText > ,
232233 pub font_size : Property < LogicalLength > ,
233234 pub font_weight : Property < i32 > ,
234235 pub color : Property < Brush > ,
@@ -248,7 +249,7 @@ pub struct MarkdownText {
248249 pub cached_rendering_data : CachedRenderingData ,
249250}
250251
251- impl Item for MarkdownText {
252+ impl Item for StyledText {
252253 fn init ( self : Pin < & Self > , _self_rc : & ItemRc ) { }
253254
254255 fn layout_info (
@@ -368,14 +369,14 @@ impl Item for MarkdownText {
368369 }
369370}
370371
371- impl ItemConsts for MarkdownText {
372+ impl ItemConsts for StyledText {
372373 const cached_rendering_data_offset: const_field_offset:: FieldOffset <
373- MarkdownText ,
374+ StyledText ,
374375 CachedRenderingData ,
375- > = MarkdownText :: FIELD_OFFSETS . cached_rendering_data . as_unpinned_projection ( ) ;
376+ > = StyledText :: FIELD_OFFSETS . cached_rendering_data . as_unpinned_projection ( ) ;
376377}
377378
378- impl HasFont for MarkdownText {
379+ impl HasFont for StyledText {
379380 fn font_request ( self : Pin < & Self > , self_rc : & crate :: items:: ItemRc ) -> FontRequest {
380381 crate :: items:: WindowItem :: resolved_font_request (
381382 self_rc,
@@ -388,13 +389,13 @@ impl HasFont for MarkdownText {
388389 }
389390}
390391
391- impl RenderString for MarkdownText {
392+ impl RenderString for StyledText {
392393 fn text ( self : Pin < & Self > ) -> SharedString {
393- self . text ( )
394+ panic ! ( )
394395 }
395396}
396397
397- impl RenderText for MarkdownText {
398+ impl RenderText for StyledText {
398399 fn target_size ( self : Pin < & Self > ) -> LogicalSize {
399400 LogicalSize :: from_lengths ( self . width ( ) , self . height ( ) )
400401 }
@@ -430,7 +431,7 @@ impl RenderText for MarkdownText {
430431 }
431432}
432433
433- impl MarkdownText {
434+ impl StyledText {
434435 pub fn font_metrics (
435436 self : Pin < & Self > ,
436437 window_adapter : & Rc < dyn WindowAdapter > ,
0 commit comments