update iced

This commit is contained in:
Ashley Wulber 2023-08-21 11:52:19 -04:00 committed by Ashley Wulber
parent 2086a0ee0e
commit 69da283aeb
10 changed files with 27 additions and 12 deletions

View file

@ -8,7 +8,10 @@ use iced::{
keyboard::{self, KeyCode},
mouse, subscription, Command, Event, Subscription,
};
use iced_core::widget::{operation, Id, Operation};
use iced_core::{
widget::{operation, Id, Operation},
Rectangle,
};
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum Message {
@ -88,6 +91,7 @@ fn unfocus_operation<T>() -> impl Operation<T> {
fn container(
&mut self,
_id: Option<&Id>,
_bounds: Rectangle,
operate_on_children: &mut dyn FnMut(&mut dyn Operation<T>),
) {
operate_on_children(self);

View file

@ -190,6 +190,7 @@ where
renderer: &Renderer,
clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>,
viewport: &Rectangle,
) -> event::Status {
self.container.on_event(
tree,
@ -199,6 +200,7 @@ where
renderer,
clipboard,
shell,
viewport,
)
}

View file

@ -177,6 +177,7 @@ where
renderer: &Renderer,
clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>,
viewport: &Rectangle,
) -> event::Status {
self.container.on_event(
tree,
@ -186,6 +187,7 @@ where
renderer,
clipboard,
shell,
viewport,
)
}

View file

@ -87,6 +87,7 @@ where
renderer: &Renderer,
clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>,
viewport: &Rectangle,
) -> event::Status {
self.content.as_widget_mut().on_event(
&mut tree.children[0],
@ -96,6 +97,7 @@ where
renderer,
clipboard,
shell,
viewport,
)
}
@ -221,6 +223,7 @@ where
renderer,
clipboard,
shell,
&layout.bounds(),
)
}

View file

@ -189,6 +189,7 @@ where
renderer: &Renderer,
clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>,
viewport: &iced_core::Rectangle,
) -> event::Status {
self.container.on_event(
tree,
@ -198,6 +199,7 @@ where
renderer,
clipboard,
shell,
viewport,
)
}

View file

@ -224,7 +224,7 @@ where
// Add text to measurement if text was given.
if let Some(text) = self.model.text(key) {
let (w, h) = renderer.measure(
let Size { width, height } = renderer.measure(
text,
self.font_size,
self.line_height,
@ -233,8 +233,8 @@ where
Shaping::Advanced,
);
button_width = w;
button_height = h;
button_width = width;
button_height = height;
}
// Add icon to measurement if icon was given.
@ -307,6 +307,7 @@ where
_renderer: &Renderer,
_clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>,
_viewport: &iced::Rectangle,
) -> event::Status {
let bounds = layout.bounds();
let state = tree.state.downcast_mut::<LocalState>();