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

Fix: make sure Tree::ui allocates the space it uses in parent Ui #71

Merged
merged 4 commits into from
Jun 18, 2024

Conversation

rydb
Copy link
Contributor

@rydb rydb commented May 31, 2024

I discovered in
#69

that the window of a tree ui does not fully fit inside the window by default. This pr fixes that issue by adding

ui.allocate_space(ui.available_size());

to the end of tree.ui().

@rydb rydb changed the title fixed window not covering the tree ui Add fix to window not covering the tree ui when not in a CentralPanel May 31, 2024
src/tree.rs Outdated
@@ -264,6 +264,8 @@ impl<Pane> Tree<Pane> {
}

self.preview_dragged_tile(behavior, &drop_context, ui);
// resizes the window to fit the ui.
ui.allocate_space(ui.available_size());
Copy link
Member

Choose a reason for hiding this comment

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

We use ui.available_rect_before_wrap() earlier.

Save that rect instead, then use ui.advance_cursor_after_rect(rect); here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, didn't notice that. changed pr to re-use rect.

src/tree.rs Outdated Show resolved Hide resolved
@emilk emilk added the include in changelog Include this in CHANGELOG.md label Jun 5, 2024
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.

needs cargo fmt

@rydb
Copy link
Contributor Author

rydb commented Jun 5, 2024

needs cargo fmt

done

@emilk emilk changed the title Add fix to window not covering the tree ui when not in a CentralPanel Fix: make sure Tree::ui allocates the space it uses in parent Ui Jun 18, 2024
@emilk emilk merged commit 9a87608 into rerun-io:main Jun 18, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog Include this in CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants