-
Notifications
You must be signed in to change notification settings - Fork 25
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
Invisible tiles #7
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking great!
if let Some(active) = self.active { | ||
if !tiles.is_visible(active) { | ||
self.active = None; | ||
} | ||
} | ||
|
||
if !self.children.iter().any(|&child| self.is_active(child)) { | ||
// Make sure something is active: | ||
self.active = self.children.first().copied(); | ||
self.active = self | ||
.children | ||
.iter() | ||
.copied() | ||
.find(|&child_id| tiles.is_visible(child_id)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of making the first visible active, it would be nice if, whenever possible, the first visible item left of the currently active would become active.
Concrete: When I make the currently active tab invisible, I the left-most visible becomes active. This feels a bit off, I'd expect a neighboring element to to get the active state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree that would be preferable, but it requires a bit more work… PRs welcome? :)
Constructing two trees the same way will now yield equal trees
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latest changes still looking good to me
Closes #2140 Sibling PR (that also needs a review!): * rerun-io/egui_tiles#7 ### What Show the layout container views in the blueprint tree view: <img width="196" alt="Screenshot 2023-06-24 at 04 29 43" src="https://github.com/rerun-io/rerun/assets/1148717/27dddd22-dbda-496c-9637-ef218890a9e1"> ### Future work * Being able to select containers * Drag-and-drop between them * Better default layout ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) <!-- This line will get updated when the PR build summary job finishes. --> PR Build Summary: https://build.rerun.io/pr/2465 <!-- pr-link-docs:start --> Docs preview: https://rerun.io/preview/60b32df/docs Examples preview: https://rerun.io/preview/60b32df/examples <!-- pr-link-docs:end -->
Closes #2140 Sibling PR (that also needs a review!): * rerun-io/egui_tiles#7 ### What Show the layout container views in the blueprint tree view: <img width="196" alt="Screenshot 2023-06-24 at 04 29 43" src="https://github.com/rerun-io/rerun/assets/1148717/27dddd22-dbda-496c-9637-ef218890a9e1"> ### Future work * Being able to select containers * Drag-and-drop between them * Better default layout ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) <!-- This line will get updated when the PR build summary job finishes. --> PR Build Summary: https://build.rerun.io/pr/2465 <!-- pr-link-docs:start --> Docs preview: https://rerun.io/preview/60b32df/docs Examples preview: https://rerun.io/preview/60b32df/examples <!-- pr-link-docs:end -->
This PR implements
is_visible/set_visible
for all tiles. Tiles are visible by default.It also refactors the
Grid
container to avoid inadvertently re-arranging the order of its children.