Skip to content

Allow resize on one both or no axis. #7047

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hydra
Copy link

@hydra hydra commented May 12, 2025

  • Note: the original API accepted a Vec2b, but didn't use the x/y properties independently, thus this is a non-breaking change and should probably be considered a bug-fix.

Video:

Recording.2025-05-12.211409.mp4
  • I have followed the instructions in the PR template

hydra added 2 commits May 12, 2025 21:17
…g checkboxes to control X/Y axis resizing.

* Note: the original API accepted a `Vec2b`, but didn't use the x/y properties independently.
@hydra hydra marked this pull request as ready for review May 12, 2025 19:24
@hydra
Copy link
Author

hydra commented May 13, 2025

Here's a video of the Resize control in combination with a table, using taffy for layout:

Recording.2025-05-13.091334.mp4

source: https://github.com/MakerPnP/makerpnp/blob/b26be8c4bc73bae1cd06011e6f4a30b793fe0f29/crates/planner_gui_egui/src/project/unit_assignments_tab.rs

This video also highlights a usability issue, where it's hard to resize a table due to the scrollbars. It's hard to find the resize handle; you have to hover around until you see the pointer change. not all of the visible area of the resize handle actually works for resizing.

@michalsustr
Copy link

A nice cool improvement would be also to change the cursor to be only horizontal/vertical/diagonal based on the available x/y/x&y

Copy link

Preview available at https://egui-pr-preview.github.io/pr/7047-resize-improvements-1
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

Comment on lines +255 to +260
if self.resizable.x {
state.desired_size.x = user_requested_size.x;
}
if self.resizable.y {
state.desired_size.y = user_requested_size.y;
}
Copy link
Owner

Choose a reason for hiding this comment

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

AFAICT this code path is only hit by Window, which should already respect resizable. Is this really changing any behavior in practice? Or is the PR just about demonstrating an existing behavior in the demo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants