@@ -7,7 +7,7 @@ use crate::{
77 graphics:: FontRequest ,
88 items:: TextStrokeStyle ,
99 lengths:: LogicalLength ,
10- textlayout:: { TextHorizontalAlignment , TextVerticalAlignment , TextWrap } ,
10+ textlayout:: { TextHorizontalAlignment , TextVerticalAlignment , TextWrap , TextOverflow } ,
1111} ;
1212use i_slint_common:: sharedfontique;
1313
@@ -38,6 +38,7 @@ pub struct LayoutOptions {
3838 pub selection : Option < std:: ops:: Range < usize > > ,
3939 pub font_request : Option < FontRequest > ,
4040 pub text_wrap : TextWrap ,
41+ pub text_overflow : TextOverflow
4142}
4243
4344impl Default for LayoutOptions {
@@ -51,6 +52,7 @@ impl Default for LayoutOptions {
5152 selection : None ,
5253 font_request : None ,
5354 text_wrap : TextWrap :: WordWrap ,
55+ text_overflow : TextOverflow :: Clip
5456 }
5557 }
5658}
@@ -92,7 +94,10 @@ pub fn layout(text: &str, scale_factor: f32, options: LayoutOptions) -> Layout {
9294 TextWrap :: WordWrap => parley:: style:: WordBreakStrength :: Normal ,
9395 TextWrap :: CharWrap => parley:: style:: WordBreakStrength :: BreakAll ,
9496 } ) ) ;
95-
97+ if options. text_overflow == TextOverflow :: Elide {
98+ todo ! ( ) ;
99+ }
100+
96101 builder. push_default ( parley:: StyleProperty :: Brush ( Brush {
97102 stroke : options. stroke ,
98103 ..Default :: default ( )
0 commit comments