[API] Make `Ui::set_cursor()` public
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
**Describe the solution you'd like**
The `set_cursor()` API is used internally to directly set the effective area of the current Ui. This can be very useful for complex/nonstandard layouts so I believe it should be made public.
It's a low-level api, sure, but egui doesn't generally shy away from those so in my opinion `set_cursor` should be no exception and just be described as such in the docs.
**Describe alternatives you've considered**
From a user perspective the only real alternative, I believe, is to use the various `Area`, `Window`, `Ui::new()`, `Ui::new_child()` and so on. This can however be sub-optimal due to compounding complexity with deeply-nested `Ui`s, unwanted features in the more high-level alternatives and potentially worse performance. There's also a few cases in which they're simply not sufficient without annoying workarounds.
From an API design perspective, perhaps we could also consider a few user-friendly wrappers like `fn add_margin(f32)`, a cross-axis counterpart to `add_space` that shifts the cursor horizontally for vertical `Ui`'s and vice versa. Not really sure, curious to know what others think.
Contributor guide
Research direction
Start by locating the existing Ui::set_cursor() entry point and read how it is currently documented and exposed internally. Make the API publicly accessible and describe its low-level behavior in the docs, then verify that the public API builds and existing tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100