summaryrefslogtreecommitdiffstats
path: root/core/src/text.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-03 02:33:40 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-03 02:33:40 +0100
commitc83809adb907498ba2a573ec9fb50936601ac8fc (patch)
tree5009581a507014cda6850f0780bd315108d56bdd /core/src/text.rs
parent3a35fd6249eeb324379d3a14b020ccc48ec16fb4 (diff)
downloadiced-c83809adb907498ba2a573ec9fb50936601ac8fc.tar.gz
iced-c83809adb907498ba2a573ec9fb50936601ac8fc.tar.bz2
iced-c83809adb907498ba2a573ec9fb50936601ac8fc.zip
Implement basic IME selection in `Preedit` overlay
Diffstat (limited to 'core/src/text.rs')
-rw-r--r--core/src/text.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/src/text.rs b/core/src/text.rs
index c144fd24..8dde9e21 100644
--- a/core/src/text.rs
+++ b/core/src/text.rs
@@ -270,6 +270,23 @@ pub struct Span<'a, Link = (), Font = crate::Font> {
pub strikethrough: bool,
}
+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,
+ }
+ }
+}
+
/// A text highlight.
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Highlight {