Widget.DynamicState

List of dynamic states made available to the style engine, for cases like CSS pseudo-classes and also used by default paint methods. It is stored in a 64 bit variable attached to the widget that you can update. The style cache is aware of the fact that these can frequently change.

The lower 32 bits are defined here or reserved for future use by the library. You should keep these updated if you reasonably can on custom widgets if they apply to you, but don't use them for a purpose they aren't defined for.

The upper 32 bits are available for your own extensions.

Values

ValueMeaning
focus(1 << 0)

the widget currently has the keyboard focus

hover(1 << 1)

the mouse is currently hovering over the widget (may not always be updated)

valid(1 << 2)

the widget's content has been validated and it passed (do not set if not validation has been performed!)

invalid(1 << 3)

the widget's content has been validated and it failed (do not set if not validation has been performed!)

checked(1 << 4)

the widget is toggleable and currently toggled on

selected(1 << 5)

the widget represents one option of many and is currently selected, but is not necessarily focused nor checked.

disabled(1 << 6)

the widget is currently unable to perform its designated task

indeterminate(1 << 7)

the widget has tri-state and is between checked and not checked

depressed(1 << 8)

the widget is being actively pressed or clicked (compare to css :active). Can be combined with hover to visually indicate if a mouse up would result in a click event.

USER_BEGIN(1UL << 32)

Meta

History

Added May 10, 2021