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

Background color settings uses new generic ui now #6480

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Jun 3, 2024

What

First practical use of automatic fallbacks for view properties that is applied both on query & ui: Query for background now goes through the new ViewProperty utility, ui now renders with the generic view property ui method.

Note how the system picks the right defaults depending on the context despite this being the same archetype:
https://github.com/rerun-io/rerun/assets/1220815/1f072048-937a-4721-b526-7bed9433b61b

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.

@Wumpf Wumpf added 📺 re_viewer affects re_viewer itself do-not-merge Do not merge this PR include in changelog labels Jun 3, 2024
Copy link

github-actions bot commented Jun 3, 2024

Deployed docs

Commit Link
4e05c5d https://landing-6lt58758w-rerun.vercel.app/docs

Copy link
Member

@jleibs jleibs left a comment

Choose a reason for hiding this comment

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

Awesome!

fn fallback_for(&self, ctx: &re_viewer_context::QueryContext<'_>) -> Color {
// Color is a fairly common component, make sure this is the right context.
if ctx.archetype_name == Some(Background::name()) {
Color::WHITE
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason our 3D views default to white but our 2D views default to black?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, that was an expressed preference by some folks at some point

Base automatically changed from andreas/view-properties-with-fallbacks to main June 3, 2024 13:10
@Wumpf Wumpf force-pushed the andreas/generic-background-ui2 branch from 94c2c73 to b8bdc66 Compare June 3, 2024 13:10
@Wumpf Wumpf removed the do-not-merge Do not merge this PR label Jun 3, 2024
@Wumpf Wumpf force-pushed the andreas/generic-background-ui2 branch from b8bdc66 to 4e05c5d Compare June 3, 2024 14:38
@Wumpf Wumpf merged commit 9aeb229 into main Jun 3, 2024
40 of 41 checks passed
@Wumpf Wumpf deleted the andreas/generic-background-ui2 branch June 3, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants