This commit is contained in:
JMARyA 2025-01-17 17:12:52 +01:00
parent 28fa0f21dc
commit 79f08fd202
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
2 changed files with 20 additions and 5 deletions

View file

@ -40,10 +40,10 @@ pub mod prelude {
pub use super::primitives::sized::Sized; pub use super::primitives::sized::Sized;
pub use super::primitives::space::{ScreenValue, SpaceBetween}; pub use super::primitives::space::{ScreenValue, SpaceBetween};
pub use super::primitives::text::{ pub use super::primitives::text::{
DecorationKind, DecorationStyle, DecorationThickness, LetterSpacing, LineClamp, LineHeight, Code, DecorationKind, DecorationStyle, DecorationThickness, LetterSpacing, LineClamp,
ListStyle, NumberStyle, Paragraph, Span, Text, TextAlignment, TextContent, TextDecoration, LineHeight, ListStyle, NumberStyle, Paragraph, Span, Text, TextAlignment, TextContent,
TextHyphens, TextOverflow, TextTransform, TextWhitespace, TextWordBreak, TextWrap, TextDecoration, TextHyphens, TextOverflow, TextTransform, TextWhitespace, TextWordBreak,
UnderlineOffset, VerticalTextAlignment, TextWrap, UnderlineOffset, VerticalTextAlignment,
}; };
pub use super::primitives::visibility::Visibility; pub use super::primitives::visibility::Visibility;
pub use super::primitives::width::{MaxWidth, MinWidth, Width}; pub use super::primitives::width::{MaxWidth, MinWidth, Width};

View file

@ -182,6 +182,21 @@ impl TextWidget {
self self
} }
#[must_use]
pub fn underlined(self) -> Self {
self.decoration(TextDecoration(DecorationKind::Underline))
}
#[must_use]
pub fn overlined(self) -> Self {
self.decoration(TextDecoration(DecorationKind::Overline))
}
#[must_use]
pub fn strikethrough(self) -> Self {
self.decoration(TextDecoration(DecorationKind::LineThrough))
}
// Weight // Weight
#[must_use] #[must_use]
@ -743,7 +758,7 @@ impl LineHeight {
// Decoration // Decoration
#[allow(non_snake_case)] #[allow(non_snake_case)]
pub fn TextDecoration<T: UIWidget + 'static>(kind: DecorationKind) -> DecorationWidget { pub fn TextDecoration(kind: DecorationKind) -> DecorationWidget {
DecorationWidget { DecorationWidget {
kind: kind.to_value().to_string(), kind: kind.to_value().to_string(),
color: None, color: None,