Atoms<'a> retreiver#8128
Conversation
|
Preview is being built... Preview will be available at https://egui-pr-preview.github.io/pr/8128-feature View snapshot changes at kitdiff |
|
I accidentally did something that closed this pull request. Sorry if somebody got duped email. |
| @@ -0,0 +1,28 @@ | |||
| pub trait GetAtoms<'a> { | |||
There was a problem hiding this comment.
Hmm, why a trait and not just adding the fn to each struct?
| } | ||
|
|
||
| impl<'a> GetAtoms<'a> for Button<'a> { | ||
| pub fn text(self) -> Atoms<'a> { |
There was a problem hiding this comment.
Why does it take self? Isn't that annoying? Maybe &self returning &Atoms would be nicer
There was a problem hiding this comment.
Honestly I don’t understand references enough to see why it matters, which is not to say it doesn’t because I really don’t know, but I’ll fix it either way. Thanks!
| @@ -0,0 +1,28 @@ | |||
| pub trait GetAtoms<'a> { | |||
| pub fn text(self) -> Atoms<'a>; | |||
There was a problem hiding this comment.
I think it should be called fn atoms() instead
I made this change on my phone sorry if it doesn’t work
Removed unused import of get_atoms module.
|
Made the last few commits on my phone because I don’t have access to WiFi. I’ll check for issues and add documentation when I can use WiFi. |
|
Should I be adding #[inline] to the atoms functions? |
A get atoms trait for Button, checkbox etc. I made it because I had time to kill after I tried sorting buttons in a Vec by the image in their atoms, but couldn't get to it because it was private.