-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Dynamic sized strips, tables, and date picker #963
Conversation
This looks amazing 😍 |
There's a lot to review here 😅 The table/grid code could really do with some documentation too, explaining the high level concepts. Adding two new crates creates a lot of extra work to maintain. However, I have been considering creating a new crate |
Looking forward to it. When will it be available? |
@emilk I reworked most of the grid and table code to be more readable and with less boilerplate. Also I merged both crates into a new crate |
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.
Very impressive! I think the new dynamic grid could be very useful. I have left a lot of questions though, and have a few more:
What happens if the contents of a cell overflows the width we allocated for it? Everything else in egui
expands the parent when this happens (parent window gets wider, etc), and I would like for this to happen here as well, if possible. It is very difficult to know beforehand how much space you need for a widget, so to have the parent layout expand as needed is quite important. This is why egui::Grid
keeps a memory of the sizes from previous frames. Of course, this adds a lot of complexity.
We also have a name-clash: egui::Grid
and egui_extras::Grid
. Can we come up with a another name?
Some other things:
- Add
egui_extras
to.github/workflows/rust.yml
- Add
egui_extras
tosh/check.sh
- Please add some labels to explain the grid-demo (just a bunch of rectangles doesn't say much)
- Add source code links from the grid and table demos
egui_demo_lib/src/apps/demo/widget_gallery/serde_date_format.rs
Outdated
Show resolved
Hide resolved
Looking forward to it. When will it be available? |
I'm pushing new commits to this branch, but they are not showing up in this PR, yet they are showing up in https://github.com/emilk/egui/commits/dynamic-grid I think GitHub is having another bad day… |
I can see your typo fix |
But can you see the nine other commits at https://github.com/emilk/egui/commits/dynamic-grid ? Do you get them if you |
You are very active! ❤️ |
Weird that only the first commit got to the shared branch… |
Do you know what is causing the width-resize bug? Seems like it should be a fairly easy fix (I hope) |
I was just inspecting it, I'm calling |
Nothing changed, and also the problem exists in 2ec346e (before any of my commits). |
I introduced the error in ae71f91 time to find the bug! |
Oh I guess it was me moving the table inside of the grid 🤦 |
This is a shortcoming of the current implementation. The strip only has one fixed dimension, the other dimension takes whatever there's left. We could add a minimum size here. This could also be added later as an option to the builder. What do you say, @emilk? |
This reverts commit dd02853.
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.
Awesome work!
Nice!! |
@elwerene |
@emilk Sure, I'll have a look some time this week :) |
A (dynamic) grid and table layout widget which allows a mixed use of size constraints:
Also contains a date picker button which is based on the dynamic grid.
This is early in development and has definitely lots of bugs and rough edges.
I didn't want to wait longer as I love the results so far and I wanted to show it and open it up for discussion!
TODO
I added many
TODO
comments in the code which I want as a minimum to get this released, like:Screenshots: