mirror of
https://github.com/Universal-Debloater-Alliance/universal-android-debloater-next-generation.git
synced 2026-08-28 02:10:39 +02:00
chore(widgets): assume Layouts must have at least 1 child
This commit is contained in:
parent
b01d310601
commit
ae2cf07fc5
1 changed files with 5 additions and 2 deletions
|
|
@ -190,14 +190,17 @@ where
|
|||
clipboard: &mut dyn Clipboard,
|
||||
shell: &mut Shell<'_, Message>,
|
||||
) -> event::Status {
|
||||
let content_bounds = layout.children().next().unwrap().bounds();
|
||||
|
||||
if let Some(message) = self.on_blur.as_ref() {
|
||||
if matches!(
|
||||
event,
|
||||
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left))
|
||||
) {
|
||||
if let Some(cursor_position) = cursor.position() {
|
||||
let content_bounds = layout
|
||||
.children()
|
||||
.next()
|
||||
.unwrap_or_else(|| unreachable!("Layout must have at least 1 child"))
|
||||
.bounds();
|
||||
if !content_bounds.contains(cursor_position) {
|
||||
shell.publish(message.clone());
|
||||
return event::Status::Captured;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue