mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 05:37:04 +00:00
menu companion layer takes no key scope, so Escape reaches the menu after the bar's list closes
This commit is contained in:
@@ -414,8 +414,9 @@ impl Container for Menu<'_> {
|
||||
|
||||
/// The companion bar, shown as a child layer of the menu's: it is in the menu's press family and closes with the
|
||||
/// menu.
|
||||
fn end(&mut self, ui: &mut Ui, _: &mut BodyCx<'_>) {
|
||||
fn end(&mut self, ui: &mut Ui, cx: &mut BodyCx<'_>) {
|
||||
let Some(bar) = self.companion.as_mut() else { return };
|
||||
eprintln!("DIAG a_press_on_the_companion_bar_or_its_popup_does_not_close_the_menu_and_the_bar_closes_with_the_menu: companion end, open={}", cx.is_open());
|
||||
let label = Env::of(ui).words::<MenuWords>().bar_companion.clone();
|
||||
let _ = CompanionLayer::new(label).show(ui, |ui, _| bar(ui));
|
||||
}
|
||||
@@ -460,7 +461,7 @@ impl CompanionLayer {
|
||||
let overlay = Overlay::floating()
|
||||
.modeless()
|
||||
.body_scroll(false)
|
||||
.focus(FocusPolicy::TAB_LAYER)
|
||||
.focus(FocusPolicy::NONE)
|
||||
.dismiss(Dismiss::new().outside(Outside::Keep))
|
||||
.place(Place::anchored(Anchor::Parent, Side::Above, Align::Center));
|
||||
let props = ContainerProps::new().mount(Mount::Layer(overlay)).surface(SurfaceKind::Floating).pad(Pad::None).sizing(Sizing::Content);
|
||||
|
||||
Reference in New Issue
Block a user