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
//! Close-semantics types for [`super::Window`]: the reason a window closed and
//! the policy for pointer presses that land outside a modal window.
//!
//! These live in their own module so the main `window.rs` stays under the
//! 800-line guardrail. [`CloseReason`] is threaded through the unified
//! [`Window::close`](super::Window) path and delivered to the `on_close`
//! callback, letting a dialog distinguish a *commit-style* dismissal
//! (click-away, when a live change should be kept) from a *cancel-style* one
//! (Escape / the × button, which restore prior state).
/// Why a [`Window`](super::Window) is closing. Delivered to the `on_close`
/// callback so a host can react differently per route — the colour dialog
/// commits a live preview on [`ClickAway`](CloseReason::ClickAway) but cancels
/// it on [`Escape`](CloseReason::Escape) / [`CloseButton`](CloseReason::CloseButton).
/// What a modal [`Window`](super::Window) does when the pointer is pressed
/// outside its own bounds.
///
/// The modal grab routes *every* press to the window's subtree (so nothing
/// leaks to widgets painted beneath); this decides what the window does with an
/// outside press once it arrives.