summaryrefslogtreecommitdiffstats
path: root/native/src/widget
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/widget')
-rw-r--r--native/src/widget/image.rs4
-rw-r--r--native/src/widget/image/viewer.rs4
-rw-r--r--native/src/widget/pick_list.rs6
-rw-r--r--native/src/widget/svg.rs4
-rw-r--r--native/src/widget/text_input.rs8
5 files changed, 13 insertions, 13 deletions
diff --git a/native/src/widget/image.rs b/native/src/widget/image.rs
index 91d68e34..8bd8ca1e 100644
--- a/native/src/widget/image.rs
+++ b/native/src/widget/image.rs
@@ -85,7 +85,7 @@ where
{
// The raw w/h of the underlying image
let image_size = {
- let (width, height) = renderer.dimensions(handle);
+ let Size { width, height } = renderer.dimensions(handle);
Size::new(width as f32, height as f32)
};
@@ -149,7 +149,7 @@ where
_cursor_position: Point,
_viewport: &Rectangle,
) {
- let (width, height) = renderer.dimensions(&self.handle);
+ let Size { width, height } = renderer.dimensions(&self.handle);
let image_size = Size::new(width as f32, height as f32);
let bounds = layout.bounds();
diff --git a/native/src/widget/image/viewer.rs b/native/src/widget/image/viewer.rs
index b1fe596c..9c83287e 100644
--- a/native/src/widget/image/viewer.rs
+++ b/native/src/widget/image/viewer.rs
@@ -108,7 +108,7 @@ where
renderer: &Renderer,
limits: &layout::Limits,
) -> layout::Node {
- let (width, height) = renderer.dimensions(&self.handle);
+ let Size { width, height } = renderer.dimensions(&self.handle);
let mut size = limits
.width(self.width)
@@ -409,7 +409,7 @@ pub fn image_size<Renderer>(
where
Renderer: image::Renderer,
{
- let (width, height) = renderer.dimensions(handle);
+ let Size { width, height } = renderer.dimensions(handle);
let (width, height) = {
let dimensions = (width as f32, height as f32);
diff --git a/native/src/widget/pick_list.rs b/native/src/widget/pick_list.rs
index c334804e..896f5b35 100644
--- a/native/src/widget/pick_list.rs
+++ b/native/src/widget/pick_list.rs
@@ -348,9 +348,9 @@ where
let state = state();
let event_status = if state.is_open {
- // TODO: Encode cursor availability in the type system
- state.is_open =
- cursor_position.x < 0.0 || cursor_position.y < 0.0;
+ // Event wasn't processed by overlay, so cursor was clicked either outside it's
+ // bounds or on the drop-down, either way we close the overlay.
+ state.is_open = false;
event::Status::Captured
} else if layout.bounds().contains(cursor_position) {
diff --git a/native/src/widget/svg.rs b/native/src/widget/svg.rs
index aa68bfb8..1015ed0a 100644
--- a/native/src/widget/svg.rs
+++ b/native/src/widget/svg.rs
@@ -83,7 +83,7 @@ where
limits: &layout::Limits,
) -> layout::Node {
// The raw w/h of the underlying image
- let (width, height) = renderer.dimensions(&self.handle);
+ let Size { width, height } = renderer.dimensions(&self.handle);
let image_size = Size::new(width as f32, height as f32);
// The size to be available to the widget prior to `Shrink`ing
@@ -120,7 +120,7 @@ where
_cursor_position: Point,
_viewport: &Rectangle,
) {
- let (width, height) = renderer.dimensions(&self.handle);
+ let Size { width, height } = renderer.dimensions(&self.handle);
let image_size = Size::new(width as f32, height as f32);
let bounds = layout.bounds();
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs
index dfc49a8d..25a8690e 100644
--- a/native/src/widget/text_input.rs
+++ b/native/src/widget/text_input.rs
@@ -92,7 +92,7 @@ where
is_secure: false,
font: Default::default(),
width: Length::Fill,
- padding: Padding::ZERO,
+ padding: Padding::new(5),
size: None,
on_change: Box::new(on_change),
on_paste: None,
@@ -716,14 +716,14 @@ where
}
return event::Status::Captured;
+ } else {
+ state.is_pasting = None;
}
}
Event::Keyboard(keyboard::Event::ModifiersChanged(modifiers)) => {
let state = state();
- if state.is_focused {
- state.keyboard_modifiers = modifiers;
- }
+ state.keyboard_modifiers = modifiers;
}
_ => {}
}