23#include "guillaume/components/overlay.hpp"
34 if (_visible == visible) {
52 if (_modal == modal) {
62 return _dismissOnOutsideClick;
67 if (_dismissOnOutsideClick == dismiss) {
70 _dismissOnOutsideClick = dismiss;
77 return _dismissOnEscape;
82 if (_dismissOnEscape == dismiss) {
85 _dismissOnEscape = dismiss;
97 if (_autoDismiss == delay) {
100 _autoDismiss = delay;
107 return _autoDismiss > 0.0f;
123 _onDismiss = handler;
Overlay & setModal(bool modal)
Declare the overlay modal (it must be answered before the rest of the interface is used) or not.
Overlay & setDismissOnOutsideClick(bool dismiss)
Choose whether a click outside the overlay dismisses it.
bool dismissesOnEscape(void) const
Tell whether the Escape key dismisses the overlay.
Overlay & setDismissOnEscape(bool dismiss)
Choose whether the Escape key dismisses the overlay.
std::function< void(void)> DismissHandler
Callback run on dismissal.
Overlay & setVisible(bool visible)
Show or hide the overlay.
Overlay(void)=default
Create a hidden, modal overlay that is dismissed on Escape and on an outside click,...
Overlay & setElapsed(float elapsed)
Store the time counted towards auto-dismissal.
Overlay & setOnDismissHandler(const DismissHandler &handler)
Set the callback run when systems::Overlay dismisses the overlay.
bool dismissesOnOutsideClick(void) const
Tell whether a click outside the overlay dismisses it.
bool hasAutoDismiss(void) const
Tell whether the overlay is dismissed by itself after a delay.
bool isModal(void) const
Tell whether the overlay is modal.
DismissHandler getOnDismissHandler(void) const
Get the callback run when the overlay is dismissed.
float getElapsed(void) const
Get how long the overlay has been counting towards its auto-dismissal.
Overlay & setAutoDismiss(float delay)
Set how long the overlay stays shown before it is dismissed by itself.
bool isVisible(void) const
Tell whether the overlay is shown.
float getAutoDismiss(void) const
Get how long the overlay stays shown before it is dismissed by itself.
void setHasChanged(bool hasChanged)
Raise or lower the changed flag.
State. Every class here is plain data attached to an entity.