summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorLibravatar KENZ <KENZ.gelsoft@gmail.com>2025-01-10 07:12:31 +0900
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-02 17:44:13 +0100
commit7db5256b720c3ecbe7c1cce7a1b47fd03151e03a (patch)
treeccf08e3f76e27d0871185b786ece83f970dddc77 /runtime
parent599d8b560bec8036c5ddda62a7bf0a540bdec396 (diff)
downloadiced-7db5256b720c3ecbe7c1cce7a1b47fd03151e03a.tar.gz
iced-7db5256b720c3ecbe7c1cce7a1b47fd03151e03a.tar.bz2
iced-7db5256b720c3ecbe7c1cce7a1b47fd03151e03a.zip
Draft `input_method` support
Diffstat (limited to 'runtime')
-rw-r--r--runtime/src/user_interface.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/runtime/src/user_interface.rs b/runtime/src/user_interface.rs
index b2826f71..6d3360d0 100644
--- a/runtime/src/user_interface.rs
+++ b/runtime/src/user_interface.rs
@@ -5,7 +5,9 @@ use crate::core::mouse;
use crate::core::renderer;
use crate::core::widget;
use crate::core::window;
-use crate::core::{Clipboard, Element, Layout, Rectangle, Shell, Size, Vector};
+use crate::core::{
+ CaretInfo, Clipboard, Element, Layout, Rectangle, Shell, Size, Vector,
+};
use crate::overlay;
/// A set of interactive graphical elements with a specific [`Layout`].
@@ -187,6 +189,7 @@ where
let mut outdated = false;
let mut redraw_request = None;
+ let mut caret_info = None;
let mut manual_overlay = ManuallyDrop::new(
self.root
@@ -230,6 +233,7 @@ where
}
_ => {}
}
+ caret_info = caret_info.or(shell.caret_info());
if shell.is_layout_invalid() {
let _ = ManuallyDrop::into_inner(manual_overlay);
@@ -332,6 +336,7 @@ where
}
_ => {}
}
+ caret_info = caret_info.or(shell.caret_info());
shell.revalidate_layout(|| {
self.base = self.root.as_widget().layout(
@@ -355,7 +360,10 @@ where
if outdated {
State::Outdated
} else {
- State::Updated { redraw_request }
+ State::Updated {
+ redraw_request,
+ caret_info,
+ }
},
event_statuses,
)
@@ -646,5 +654,7 @@ pub enum State {
Updated {
/// The [`window::RedrawRequest`] when a redraw should be performed.
redraw_request: Option<window::RedrawRequest>,
+ /// TODO
+ caret_info: Option<CaretInfo>,
},
}