Skip to content
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

Remove ReUi and move its methods to egui::{Ui|Context} extension traits and to DesignTokens #6506

Merged
merged 19 commits into from
Jun 5, 2024

Conversation

abey79
Copy link
Member

@abey79 abey79 commented Jun 5, 2024

What

This PR:

  • Introduces UiExt and ContextExt extension traits for egui::Ui, resp. egui::Context.
  • Refactor DesignTokens such that it's globally available via re_ui::design_token().
  • A new re_ui::apply_style_and_install_loaders(&egui::Context) function is introduced to initialise Rerun style in egui.
  • ReUi is removed, and it's methods are dispatched to DesignTokens, ContextExt, and UiExt, depending on their nature.
  • All re_ui::ReUi references are removed from the code base. Some structures which formerly held a ReUi now hold a egui::Context instead (including App and ViewerContext).
  • Added some rules to clippy.toml to forbid the use of some egui functions/type that are replaced by our own (e.g. checkbox() and radio_value()). Cleaned up a redundant lint to that effect in scripts/lint.py.

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!

To run all checks from main, comment on the PR with @rerun-bot full-check.

@abey79 abey79 added 🚜 refactor Change the code, not the functionality exclude from changelog PRs with this won't show up in CHANGELOG.md labels Jun 5, 2024
@abey79 abey79 changed the title Antoine/no more re UI Remove ReUi and move its methods to egui::{Ui|Context} extension traits and to DesignTokens Jun 5, 2024
@abey79 abey79 marked this pull request as ready for review June 5, 2024 15:49
@emilk emilk self-requested a review June 5, 2024 16:34
Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome; let's merge this asap

clippy.toml Outdated Show resolved Hide resolved
crates/re_data_ui/src/annotation_context.rs Outdated Show resolved Hide resolved
crates/re_ui/src/lib.rs Outdated Show resolved Hide resolved
crates/re_ui/src/lib.rs Outdated Show resolved Hide resolved
@abey79 abey79 merged commit 5abbd29 into main Jun 5, 2024
36 checks passed
@abey79 abey79 deleted the antoine/no-more-re-ui branch June 5, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from changelog PRs with this won't show up in CHANGELOG.md 🚜 refactor Change the code, not the functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move re_ui UI functions to a trait to be implemented by egui::Ui
2 participants