fix(editor): dismiss the Effects add-menu on outside click on web

The native press path closed the new Effects "+" add-menu on an
outside click, but the web host had no matching dismiss, so the menu
could get stuck open. Mirror the fill-type-picker dismiss: apply a row
action, swallow inside clicks, close on any outside click.
This commit is contained in:
Kayshen-X 2026-07-04 21:52:27 +08:00
parent 3480abaa52
commit 2e8bf40f47

View file

@ -460,6 +460,33 @@ impl WidgetHost {
return true;
}
// 0c0z. Effects "+" add-menu — outside-click dismiss.
if self.editor_state.editor_ui.effect_add_picker_open {
if let Some(panel) = PropertyPanel::for_selection(&self.editor_state) {
let property_rect = Rect {
origin: Point2D::new(
viewport_width - self.editor_state.editor_ui.property_panel_width,
TOP_BAR_HEIGHT,
),
size: Point2D::new(
self.editor_state.editor_ui.property_panel_width,
(viewport_height - TOP_BAR_HEIGHT).max(0.0),
),
};
match panel.effect_add_menu_hit(property_rect, Point2D::new(x, y)) {
op_editor_ui::widgets::EffectAddMenuHit::Row(action) => {
self.apply_property_action(action);
return true;
}
op_editor_ui::widgets::EffectAddMenuHit::Inside => return true,
op_editor_ui::widgets::EffectAddMenuHit::Outside => {}
}
}
self.editor_state.editor_ui.close_effect_add_picker();
self.mark_dirty();
return true;
}
// 0c0a0. Fill/stroke colour-variable picker — outside-click dismiss.
if self
.editor_state