feat(ui_component): add tapped control state

This commit is contained in:
Hugo Pointcheval 2023-02-13 17:06:56 +01:00
parent 8d66d3d4d2
commit 9186efa07a
Signed by: hugo
GPG Key ID: 3AAC487E131E00BC

View File

@ -24,6 +24,9 @@ enum ControlState {
/// When the mouse cursor is hover the control /// When the mouse cursor is hover the control
hovered, hovered,
/// When the control is clicked
tapped,
/// When the control is focused (like pressing tab) /// When the control is focused (like pressing tab)
focused, focused,
@ -36,6 +39,7 @@ enum ControlState {
bool isDisabled() => this == ControlState.disabled; bool isDisabled() => this == ControlState.disabled;
bool isEnabled() => this != ControlState.disabled; bool isEnabled() => this != ControlState.disabled;
bool isHovered() => this == ControlState.hovered; bool isHovered() => this == ControlState.hovered;
bool isTapped() => this == ControlState.tapped;
bool isFocused() => this == ControlState.focused; bool isFocused() => this == ControlState.focused;
bool isSelected() => this == ControlState.selected; bool isSelected() => this == ControlState.selected;
bool isInvalid() => this == ControlState.invalid; bool isInvalid() => this == ControlState.invalid;