-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add Label text selection api #7541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Preview available at https://egui-pr-preview.github.io/pr/7541-labelselectedcharrange |
Sorry this is very conflicted now that I've merged the new plugin trait. You'll have to update it to fetch the label selection state via the plugin helpers |
Cool! It would be nice if the egui_demo_lib used this new functionality. Also: please add a kittest test of it 🙏 |
I still need to find a way to get selections across multiple widgets.. So far I was only able to get the latest selection in the current Context per Viewport. For my app I need to be able to fetch all current selections, across any widgets in the current context and viewport. I will look at the new plugin api and go from there. |
3dd884f
to
2cf4a21
Compare
I reworked the api a bit and added an example project as a demo. I have added a map in I am thinking about storing an entire WidgetSelectionState in this map, to store Otherwise the range calculation will be wrong if the calls to widget_cursor_range on a Response come after another widget has been rendered (because they all share the LabelSelectionState and update primary_reached, ...). The example shows how to do it correctly at the moment, by extracting the cursor_range in the same iteration the Label is rendered. |
These changes were generated by Claude AI.