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
//! Whether a widget is drawn.
//!
//! A submenu exists for as long as the menu it belongs to does -- it is
//! spawned with its parent and hidden, rather than spawned on hover and
//! despawned on leave. Two reasons: a button carries a callback, which is not
//! something that can be cloned and re-made every time a pointer crosses it;
//! and a menu that builds itself on hover is a menu that allocates on hover.
//!
//! Hiding is a *field* and not a marker component, which is the other half of
//! the same argument. Adding and removing a marker moves the entity between
//! archetypes, so a pointer sliding along a menu would rebuild the table on
//! every frame it crossed a boundary -- and a queued insert can land after
//! the entity has been despawned, which is an error rather than a no-op.
//! A bool is neither of those things.
use *;
/// Whether the widget on this entity is drawn and can be interacted with.
///
/// Absent means visible: most widgets never hide, and should not have to say
/// so.
;
/// Whether a widget with this (possibly absent) visibility is drawn.