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
//! Global safe-area inset provider: `use_safe_area()` and `set_safe_area()`.
//!
//! Some platforms reserve screen regions the app shouldn't draw into (iOS
//! status bar / Dynamic Island / home indicator; Android status/nav bars).
//! Rather than have every widget branch on platform, the platform layer
//! measures the inset once and publishes it here; widgets (starting with
//! `Scaffold`) read it as ordinary padding. Desktop/web never set it, so it
//! defaults to zero and nothing changes for them.
use GlobalAtom;
use AtomId;
/// Reserved atom ID for the safe-area atom (must not collide with other
/// reserved IDs — see `rosace_theme::provider::THEME_ATOM_ID` at 0xFFFF).
const SAFE_AREA_ATOM_ID: AtomId = AtomId;
/// Inset amounts on each edge, in logical pixels.
static CURRENT_SAFE_AREA: = new;
/// Returns the currently active safe-area insets (zero on platforms that
/// don't have any — desktop, web).
/// Replaces the active safe-area insets. Called by the platform layer on
/// startup and on resize/rotation; app code should not normally call this.