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
//! Push buttons: the one control with no value at all.
//!
//! A push button stores nothing and commits nothing. It has a pressed
//! appearance and an action, and the action is the whole point of it.
//!
//! # The asserted-broken behaviour
//!
//! Pressing Return on a focused push button **does not fire its action**, and
//! the event is reported as not consumed. That is what the oracle does today,
//! it is what its own tests assert, and both sites carry an upstream bug
//! reference saying the numbers "should" be one and true. It is reproduced
//! as-asserted: the goldens contain this behaviour, and an implementation
//! that fixed it would fail the tests that pin it. When upstream fixes it,
//! the diff here will be a recognizable one-line change rather than a mystery.
/// A push button's interaction state.
///
/// ```
/// use pdfrum_form::field::ButtonState;
///
/// let mut state = ButtonState::new();
/// assert!(!state.pressed);
/// state.pressed = true;
/// assert!(state.pressed);
/// ```