ui: send events to active subview only in CompactListing

embed
Manos Pitsidianakis 2019-05-07 01:56:53 +03:00
parent aade41401e
commit 59d912e2ee
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 2 additions and 4 deletions

View File

@ -730,6 +730,7 @@ impl ListingTrait for CompactListing {
}
fn set_coordinates(&mut self, coordinates: (usize, usize, Option<EnvelopeHash>)) {
self.views[self.cursor].new_cursor_pos = (coordinates.0, coordinates.1, 0);
self.views[self.cursor].unfocused = false;
}
}
@ -789,10 +790,7 @@ impl Component for CompactListing {
| UIEvent::EnvelopeUpdate(_)
| UIEvent::EnvelopeRename(_, _, _)
| UIEvent::EnvelopeRemove(_) => {
return self
.views
.iter_mut()
.fold(false, |acc, v| acc || v.process_event(event, context));
return self.views[self.cursor].process_event(event, context)
}
_ => return self.views[self.cursor].process_event(event, context),
}