1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! Shared widget utilities — modal backdrop overlay and type-stable placeholder.
use ;
use ;
/// Wrap dialog content in a centered modal overlay with a semi-transparent
/// backdrop that closes on click.
///
/// This is the shared helper for all modal backdrop patterns across the
/// dashboard. It creates a stack with a click-to-dismiss backdrop and a
/// centered container for the dialog content.
///
/// This helper does **not** apply `dialog_container_style` or padding —
/// callers are responsible for styling their content as needed before
/// passing it in.
///
/// # Parameters
/// - `content`: The dialog body to overlay. Should already be styled
/// (container, padding, etc.) by the caller as needed.
/// - `on_backdrop`: Message to emit when the backdrop is clicked.
/// - `opacity`: Opacity of the backdrop (e.g., `0.5` for standard
/// semi-transparent black, `0.4` for lighter).
/// Zero-size placeholder that keeps an overlay slot's widget type stable
/// across show/hide transitions. Iced destroys widget state (scroll
/// positions, open popovers) when the widget tree tag changes between
/// frames, so the closed state must return the identical bare Container.
/// Callers whose open state is a Stack (board.rs, settings.rs modal
/// overlays) must wrap this in `iced::widget::stack([...])` themselves.
/// Known pre-existing quirks, not fixed here: git.rs's closed-branch is
/// unreachable (`view()` is gated on the modal being open), and the mod.rs
/// diff/branch overlay slots use a bare-Container placeholder against
/// Stack open states (type mismatch predates this helper).