Skip to content

Provide Plugin::run() with an egui:Ui #197

@abey79

Description

@abey79

Plugins are currently only provided with a painter. Although this is sufficient for drawing, it may building interactive element more complicated, in particular tooltips.

My (possibly naive) suggestion would be:

  • in Map::ui(), allocate a child ui that uses the provided Ui's available_size().
  • pass this child ui directly to Plugin::run(), instead of the Response and Painter (both of which can be obtained from the Ui.

That would, of course, be a breaking change. If that's a concern, one could add a Plugin::run_ui() method which by default delegates to the existing Plugin::run() without changing its signature.

Would you accept such a PR? If so, would be ok with the breaking change or prefer the work-around?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions