Skip to content

feathers: Widgets should document which events they emit #21515

@torsteingrindvik

Description

@torsteingrindvik

How can Bevy's documentation be improved?

The controls here:

https://dev-docs.bevy.org/bevy/feathers/controls/index.html

For example button:

https://dev-docs.bevy.org/bevy/feathers/controls/fn.button.html

should specify in docs which event (or events) they emit when interacted with.

Currently the only way to know is to look at the feathers example to see which events are observed close to some control, for example: On<ValueChange<bool>>, On<Activate>, On<ValueChange<f32>>, etc.

Ideally each control had a snippet in the docs to the effect of

// From the feathers example, a relatively minimal snippet of how to observe checkbox interactions
(
    checkbox(
        InteractionDisabled,
        Spawn((Text::new("Disabled"), ThemedText))
    ),
    observe(|_change: On<ValueChange<bool>>| {
        warn!("Disabled checkbox clicked!");
    })
),

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-UIGraphical user interfaces, styles, layouts, and widgetsC-DocsAn addition or correction to our documentationD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed upon

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions