clippy
This commit is contained in:
parent
df4b94edf2
commit
2dd6137459
19 changed files with 42 additions and 53 deletions
|
|
@ -289,7 +289,7 @@ where
|
|||
}
|
||||
|
||||
fn diff(&mut self, tree: &mut Tree) {
|
||||
tree.diff_children(std::slice::from_mut(&mut self.content))
|
||||
tree.diff_children(std::slice::from_mut(&mut self.content));
|
||||
}
|
||||
|
||||
fn size(&self) -> Size<Length> {
|
||||
|
|
|
|||
|
|
@ -461,7 +461,7 @@ where
|
|||
size,
|
||||
line_height,
|
||||
shaping,
|
||||
wrap,
|
||||
wrap: _,
|
||||
} = &self.icon;
|
||||
let size = size.unwrap_or(Pixels(bounds.height * 0.7));
|
||||
|
||||
|
|
|
|||
|
|
@ -592,7 +592,7 @@ pub fn visible_bounds(id: Id) -> Task<Option<Rectangle>> {
|
|||
}
|
||||
|
||||
task::widget(VisibleBounds {
|
||||
target: id.into(),
|
||||
target: id,
|
||||
depth: 0,
|
||||
scrollables: Vec::new(),
|
||||
bounds: None,
|
||||
|
|
|
|||
|
|
@ -164,11 +164,11 @@ impl Default for State {
|
|||
fn default() -> Self {
|
||||
Self {
|
||||
is_hovered: Default::default(),
|
||||
drag_initiated: Default::default(),
|
||||
drag_initiated: None,
|
||||
is_out_of_bounds: true,
|
||||
last_click: Default::default(),
|
||||
last_click: None,
|
||||
cursor_position: None,
|
||||
bounds: Default::default(),
|
||||
bounds: Rectangle::default(),
|
||||
previous_click: None,
|
||||
}
|
||||
}
|
||||
|
|
@ -351,7 +351,7 @@ where
|
|||
renderer: &Renderer,
|
||||
dnd_rectangles: &mut crate::core::clipboard::DndDestinationRectangles,
|
||||
) {
|
||||
if let Some(state) = state.children.iter().next() {
|
||||
if let Some(state) = state.children.first() {
|
||||
self.content.as_widget().drag_destinations(
|
||||
state,
|
||||
layout,
|
||||
|
|
@ -420,20 +420,19 @@ fn update<Message: Clone, Theme, Renderer>(
|
|||
}
|
||||
|
||||
if !cursor.is_over(layout.bounds()) {
|
||||
if !state.is_out_of_bounds {
|
||||
if widget
|
||||
if !state.is_out_of_bounds
|
||||
&& widget
|
||||
.on_enter
|
||||
.as_ref()
|
||||
.or(widget.on_exit.as_ref())
|
||||
.is_some()
|
||||
{
|
||||
if let Event::Mouse(mouse::Event::CursorMoved { .. }) = event {
|
||||
state.is_out_of_bounds = true;
|
||||
if let Some(message) = widget.on_exit.as_ref() {
|
||||
shell.publish(message.clone());
|
||||
}
|
||||
return;
|
||||
{
|
||||
if let Event::Mouse(mouse::Event::CursorMoved { .. }) = event {
|
||||
state.is_out_of_bounds = true;
|
||||
if let Some(message) = widget.on_exit.as_ref() {
|
||||
shell.publish(message.clone());
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
use iced_renderer::core::widget::Operation;
|
||||
|
||||
use crate::container;
|
||||
use crate::core::layout;
|
||||
use crate::core::mouse;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
use iced_renderer::core::widget::Operation;
|
||||
|
||||
use crate::container;
|
||||
use crate::core::layout;
|
||||
use crate::core::mouse;
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ where
|
|||
}
|
||||
|
||||
fn diff(&mut self, tree: &mut Tree) {
|
||||
tree.diff_children(&mut self.children)
|
||||
tree.diff_children(&mut self.children);
|
||||
}
|
||||
|
||||
fn size(&self) -> Size<Length> {
|
||||
|
|
|
|||
|
|
@ -470,7 +470,7 @@ where
|
|||
}
|
||||
|
||||
fn diff(&mut self, tree: &mut Tree) {
|
||||
tree.diff_children(std::slice::from_mut(&mut self.content))
|
||||
tree.diff_children(std::slice::from_mut(&mut self.content));
|
||||
}
|
||||
|
||||
fn size(&self) -> Size<Length> {
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ where
|
|||
tree.diff_children(&mut [
|
||||
self.content.as_widget_mut(),
|
||||
self.tooltip.as_widget_mut(),
|
||||
])
|
||||
]);
|
||||
}
|
||||
|
||||
fn layout(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue