-
Notifications
You must be signed in to change notification settings - Fork 567
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
Add a widget gallery example. #1010
Conversation
b56724e
to
7d441dd
Compare
Friendly bump |
Ping @cmyr I think something like this to show off widgets would be cool. :) The main review task is to have a look at the example when run and see if it's something you would like to add. |
right yea I was looking at this yesterday and then got distracted wanting to clean up assets in examples; see #1027. I'll get a review in soonish! |
Ooh ok I do have an asset so maybe I need to move it. |
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.
Looks good, a few little nits inline.
high-level stuff: I might include the image and svg widgets, maybe just displaying some text like "requires the "image" feature" if those features aren't available; and for those I would reuse existing assets, because why not.
I'm not sure I would include Painter
, and if I did I would use it to show something particularly weird, like a clipped gradient or some other sort of drawing that would be a reason to use it.
Oh also there's now a spinner widget, which it might be worth including?
I added a spinner example. :) |
huh, that CI failure is weird; seems to happen across a bunch of crates on the current nightly, and unrelated to this PR; will look to open an issue somewhere if this persists over the next few days. |
Okay only last thing, per my previous comment:
That is: we have an image widget, which should be used to display images; painter is more about implementing some sort of custom reusable drawing code. I could imagine it not being included here (since this is mostly about control/ui widgets?) but if it is I would use an example that was a bit more custom; and if I'm including |
I'm sorry I will get round to this eventually. |
No rush, whenever is convenient, nothing is blocked by this PR. |
The `Grid` used to display them is also probably useful in other situations.
Co-authored-by: Colin Rofls <[email protected]>
- Use `im::Vector<_>` rather than `Arc<Vec<_>>` - Add `Image` and `Svg` examples. - Use some more fancy stuff in the `Painter` example.
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.
@derekdreery apologies for letting this sit.
A few little inline comments.
One other thought arises: this almost feels like it should be a multi-file example, since there's so much going on in this file? but we haven't done that yet, so I'm okay with not doing it for this.
The grid widget from this example might be useful to others, should I put it in druid itself? |
So that's a good question. I do think we will want a more robust 'collection view' widget, but I don't know exactly what that should look like, but I'd want it to cover a pretty wide variety of use cases. Doing this though probably requires us to figure out a general approach to collections in general, and for that I would start by trying to clean up and improve the API of the |
Should be ready for review again. |
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.
Okay, thanks @derekdreery and sorry for the long wait!
no worries :) |
I thought a widget gallery might be useful for people to see what widgets are available (like Flutter).
The
Grid
used to display them is also probably useful in other situations.