summaryrefslogtreecommitdiffstats
path: root/widget/src/scrollable.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 /widget/src/scrollable.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 'widget/src/scrollable.rs')
-rw-r--r--widget/src/scrollable.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs
index 2dbe0479..a51a8625 100644
--- a/widget/src/scrollable.rs
+++ b/widget/src/scrollable.rs
@@ -33,8 +33,9 @@ use crate::core::widget::operation::{self, Operation};
use crate::core::widget::tree::{self, Tree};
use crate::core::window;
use crate::core::{
- self, Background, Clipboard, Color, Element, Event, Layout, Length,
- Padding, Pixels, Point, Rectangle, Shell, Size, Theme, Vector, Widget,
+ self, Background, Clipboard, Color, Element, Event, InputMethod, Layout,
+ Length, Padding, Pixels, Point, Rectangle, Shell, Size, Theme, Vector,
+ Widget,
};
use crate::runtime::task::{self, Task};
use crate::runtime::Action;
@@ -728,6 +729,8 @@ where
_ => mouse::Cursor::Unavailable,
};
+ let had_input_method = shell.input_method().is_open();
+
let translation =
state.translation(self.direction, bounds, content_bounds);
@@ -745,6 +748,14 @@ where
..bounds
},
);
+
+ if !had_input_method {
+ if let InputMethod::Open { position, .. } =
+ shell.input_method_mut()
+ {
+ *position = *position + translation;
+ }
+ }
};
if matches!(