Simplify canvas control focus guard for strict lint
This commit is contained in:
@@ -158,8 +158,7 @@ impl<Message: Clone, R: renderer::Renderer> Widget<Message, Theme, R> for Contro
|
|||||||
if matches!(
|
if matches!(
|
||||||
event,
|
event,
|
||||||
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left))
|
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left))
|
||||||
) {
|
) && !layout
|
||||||
if !layout
|
|
||||||
.bounds()
|
.bounds()
|
||||||
.intersection(viewport)
|
.intersection(viewport)
|
||||||
.is_some_and(|bounds| cursor.is_over(bounds))
|
.is_some_and(|bounds| cursor.is_over(bounds))
|
||||||
@@ -167,7 +166,6 @@ impl<Message: Clone, R: renderer::Renderer> Widget<Message, Theme, R> for Contro
|
|||||||
state.focused = false;
|
state.focused = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if matches!(event, Event::Window(iced::window::Event::Unfocused)) {
|
if matches!(event, Event::Window(iced::window::Event::Unfocused)) {
|
||||||
state.focused = false;
|
state.focused = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user