Padding takes KeyOrValue, TEXTBOX_INSETS moves back to Env#1662
Merged
Conversation
futurepaul
reviewed
Mar 18, 2021
druid/src/widget/padding.rs
Outdated
| child: WidgetPod<T, W>, | ||
| } | ||
|
|
||
| /// `Insets`, types that impl `Into<Insts>`, or KeyOrValue<Insets>. |
Collaborator
There was a problem hiding this comment.
typo? Into<Insets>
Also, is there a reason this had to be a trait instead of just impl Into? I haven't been following closely so pls disregard if this is obvious.
Member
Author
There was a problem hiding this comment.
You're right, I'd been over-thinking this. The problem is that we don't just accept Insets, we also accept things like f64 and (f64, f64), and I was thinking that to make those work we would need to have impl <T: Into<Insets>> Into<KeyOrValue<Insets>> for T, which wouldn't work because of coherence, but we can instead just manually impl Into<KeyOrValue<Insets>> for the various other arguments we want to accept, and that works fine. Thanks!
e3fece3 to
4e23805
Compare
4e23805 to
fbb9ede
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
two related commits; the first enabling the second.
This is more progress on #1652.