Skip to content

Commit

Permalink
Make CaretInfo member order match to my proposal post
Browse files Browse the repository at this point in the history
  • Loading branch information
kenz-gelsoft committed Feb 2, 2025
1 parent f6c4b03 commit 3322aee
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/src/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use crate::{event, Point};
/// TODO
#[derive(Clone, Copy, Debug)]
pub struct CaretInfo {
/// TODO
pub allowed: bool,
/// TODO
pub position: Point,
/// TODO
pub input_method_allowed: bool,
}

/// A connection to the state of a shell.
Expand Down
2 changes: 1 addition & 1 deletion widget/src/scrollable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,11 +749,11 @@ where
if children_may_have_caret {
if let Some(caret_info) = shell.caret_info() {
shell.update_caret_info(Some(CaretInfo {
allowed: caret_info.allowed,
position: Point::new(
caret_info.position.x - translation.x,
caret_info.position.y - translation.y,
),
input_method_allowed: caret_info.input_method_allowed,
}));
}
}
Expand Down
2 changes: 1 addition & 1 deletion widget/src/text_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,8 @@ where
.unwrap_or(Rectangle::default());
let bottom_left = Point::new(rect.x, rect.y + rect.height);
Some(CaretInfo {
allowed: true,
position: bottom_left,
input_method_allowed: true,
})
} else {
None
Expand Down
2 changes: 1 addition & 1 deletion widget/src/text_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1340,8 +1340,8 @@ where
.unwrap_or(Rectangle::with_size(Size::<f32>::default()));
let bottom_left = Point::new(rect.x, rect.y + rect.height);
Some(CaretInfo {
allowed: true,
position: bottom_left,
input_method_allowed: true,
})
} else {
None
Expand Down
2 changes: 1 addition & 1 deletion winit/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ fn update_input_method<P, C>(
P: Program,
C: Compositor<Renderer = P::Renderer> + 'static,
{
window.raw.set_ime_allowed(caret_info.allowed);
window.raw.set_ime_allowed(caret_info.input_method_allowed);
window.raw.set_ime_cursor_area(
LogicalPosition::new(caret_info.position.x, caret_info.position.y),
LogicalSize::new(10, 10),
Expand Down

0 comments on commit 3322aee

Please sign in to comment.