-
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
Fix: make sure Tree::ui
allocates the space it uses in parent Ui
#71
Conversation
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()); |
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.
We use ui.available_rect_before_wrap()
earlier.
Save that rect instead, then use ui.advance_cursor_after_rect(rect);
here
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.
ah, didn't notice that. changed pr to re-use rect.
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.
needs cargo fmt
done |
Tree::ui
allocates the space it uses in parent Ui
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
to the end of
tree.ui()
.