62 last_anchor_ = anchor;
65 text_ = std::move(
text);
66 position_ = compute_position(anchor);
69 opacity_.animate_to(1.0f, fade_duration_);
74 text_ = std::move(
text);
75 position_ = compute_position(anchor);
84 last_anchor_ = anchor;
86 position_ = compute_position(anchor);
98 opacity_.animate_to(0.0f, fade_duration_);
107 elapsed_pending_ = 0;
120 elapsed_pending_ += dt;
121 if (elapsed_pending_ >= hover_delay_) {
124 opacity_.animate_to(1.0f, fade_duration_);
125 elapsed_visible_ = 0;
130 opacity_.advance(dt);
131 elapsed_visible_ += dt;
132 if (auto_hide_ > 0 && elapsed_visible_ >= auto_hide_) {
135 return opacity_.animating() || (auto_hide_ > 0);
138 opacity_.advance(dt);
139 if (!opacity_.animating()) {
158 float opacity()
const {
return opacity_.value(); }
160 const std::string&
text()
const {
return text_; }
192 return {anchor.x + cursor_offset_.x, anchor.y + cursor_offset_.y};
197 Point last_anchor_{};
200 float hover_delay_ = 0.6f;
201 float fade_duration_ = 0.12f;
202 float auto_hide_ = 0.0f;
203 Point cursor_offset_{12, 18};
205 float elapsed_pending_ = 0;
206 float elapsed_visible_ = 0;
207 ValueAnimation opacity_{0.0f};
System-level reduced-motion preferences.
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
Definition geometry.hpp:20