Skip to content

dont use widgets for padding in flex#1584

Merged
cmyr merged 19 commits intolinebender:masterfrom
JAicewizard:non_widget_padding
Feb 18, 2021
Merged

dont use widgets for padding in flex#1584
cmyr merged 19 commits intolinebender:masterfrom
JAicewizard:non_widget_padding

Conversation

@JAicewizard
Copy link
Contributor

Having a special purpose widget just for padding in flexes is a bit too flexible ( ;) ), and not needed. It really doesnt need to be a widget, if we just store the amount of padding (px/flex) we can easily calculate its width and layout.

fixes #1566

@cmyr cmyr added the S-needs-review waits for review label Feb 15, 2021
Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

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

Okay, this looks good. I was a little concerned it would be harder to understand, but I don't really think that's the case.

I have a few notes inline, but nothing blocking, will give you a chance to address what you want and then merge.

Thanks!

Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

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

Was initially going to just make some notes and merge this but I think you can clean it up by quite a bit by using flat_map instead of map, and by using more concise destructuring syntax.

Sorry for the nits, will be nice to have this all cleaned up though. :)

Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

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

Basically there :)

JAicewizard and others added 3 commits February 18, 2021 22:16
Co-authored-by: Colin Rofls <colin@cmyr.net>
Co-authored-by: Colin Rofls <colin@cmyr.net>
Co-authored-by: Colin Rofls <colin@cmyr.net>
Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@cmyr cmyr merged commit 47fb9fb into linebender:master Feb 18, 2021
richard-uk1 pushed a commit to richard-uk1/druid that referenced this pull request Apr 6, 2021
* move spacers away from being widget backed

* small cleanup

* other implementation

* fix??

* small performance improvements

* undo changes in example

* undo changes in example

* undo changes in example

* fmt

* add changelog

* mode to struct fields and add `.widget{_mut}` method on flex children

* fmt

* _even better_ nice looking stuff

* Update druid/src/widget/flex.rs

Co-authored-by: Colin Rofls <colin@cmyr.net>

* Update druid/src/widget/flex.rs

Co-authored-by: Colin Rofls <colin@cmyr.net>

* Update druid/src/widget/flex.rs

Co-authored-by: Colin Rofls <colin@cmyr.net>

* Apply suggestions from code review

Co-authored-by: Colin Rofls <colin@cmyr.net>
xarvic pushed a commit to xarvic/druid that referenced this pull request Apr 7, 2021
* move spacers away from being widget backed

* small cleanup

* other implementation

* fix??

* small performance improvements

* undo changes in example

* undo changes in example

* undo changes in example

* fmt

* add changelog

* mode to struct fields and add `.widget{_mut}` method on flex children

* fmt

* _even better_ nice looking stuff

* Update druid/src/widget/flex.rs

Co-authored-by: Colin Rofls <colin@cmyr.net>

* Update druid/src/widget/flex.rs

Co-authored-by: Colin Rofls <colin@cmyr.net>

* Update druid/src/widget/flex.rs

Co-authored-by: Colin Rofls <colin@cmyr.net>

* Apply suggestions from code review

Co-authored-by: Colin Rofls <colin@cmyr.net>
@maan2003 maan2003 removed the S-needs-review waits for review label May 3, 2021
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.

Flex spacers should not be implemented as widgets.

3 participants