summaryrefslogtreecommitdiffstats
path: root/core/src/text.rs
diff options
context:
space:
mode:
authorLibravatar Héctor <hector@hecrj.dev>2025-02-03 22:49:28 +0100
committerLibravatar GitHub <noreply@github.com>2025-02-03 22:49:28 +0100
commit5ab056318e7c2db981f008bd65d9e0b2aacb46c5 (patch)
tree5aa3e2cdb69dd85fe247ba15c8cfc22bb53dd961 /core/src/text.rs
parentca009ba92af72c09ec6f22ca4eea06fe6228f19d (diff)
parentbab18858cd60168b63ae442026f45a90eb6be731 (diff)
downloadiced-5ab056318e7c2db981f008bd65d9e0b2aacb46c5.tar.gz
iced-5ab056318e7c2db981f008bd65d9e0b2aacb46c5.tar.bz2
iced-5ab056318e7c2db981f008bd65d9e0b2aacb46c5.zip
Merge pull request #2777 from kenz-gelsoft/explore-input-method2
Input Method Support
Diffstat (limited to 'core/src/text.rs')
-rw-r--r--core/src/text.rs27
1 files changed, 18 insertions, 9 deletions
diff --git a/core/src/text.rs b/core/src/text.rs
index c144fd24..a7e1f281 100644
--- a/core/src/text.rs
+++ b/core/src/text.rs
@@ -284,15 +284,7 @@ impl<'a, Link, Font> Span<'a, Link, Font> {
pub fn new(fragment: impl IntoFragment<'a>) -> Self {
Self {
text: fragment.into_fragment(),
- size: None,
- line_height: None,
- font: None,
- color: None,
- highlight: None,
- link: None,
- padding: Padding::ZERO,
- underline: false,
- strikethrough: false,
+ ..Self::default()
}
}
@@ -440,6 +432,23 @@ impl<'a, Link, Font> Span<'a, Link, Font> {
}
}
+impl<Link, Font> Default for Span<'_, Link, Font> {
+ fn default() -> Self {
+ Self {
+ text: Cow::default(),
+ size: None,
+ line_height: None,
+ font: None,
+ color: None,
+ link: None,
+ highlight: None,
+ padding: Padding::default(),
+ underline: false,
+ strikethrough: false,
+ }
+ }
+}
+
impl<'a, Link, Font> From<&'a str> for Span<'a, Link, Font> {
fn from(value: &'a str) -> Self {
Span::new(value)