-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Box layout with custom padding #1031
Comments
The default layouts use theme padding, just like the standard widgets use theme colours. |
So I had to replicate the box layout code with a couple changed lines to support custom (zero) padding. It would be nice to support NewVBoxWithPadding() and NewHBoxWithPadding() functions for the existing box layout having really minimal changes. If I'll create a PR would you accept that? |
The box widgets are designed for laying out other widgets in a consistent manner. |
Oh, I meant layouts, not the widgets, i.e. |
I think that it's probably still the same case - you are working on what should probably be a widget so adding customisation to standard components to support that doesn't make sense to the core API. At some point we should complete the more advanced layout options (like #4) that make "anything possible" but the simple layout API should probably always use the theme like widgets |
I am going to close this as won't fix because you are building a widget and most widgets have custom layouts. If you still think that generic layouts should have custom padding it probably would need to be added to them all. |
Introduce a `LayoutOption` concept, and allow setting custom paddings for a Layout. The `BaseLayout` struct implements the default paddings retrieval, to reduce the amount of changes required by project maintainers to comply with the new interface methods. This change uses the Option pattern in case other customizations can be added to Layouts in the future, without changing the public API. Main motivation for this change has been Supersonic needing to copy the entire Vbox/Hbox implementation, just to add custom paddings [1]. Also related to feature request fyne-io#1031. [1]
Introduce a `LayoutOption` concept, and allow setting custom paddings for a Layout. The `BaseLayout` struct implements the default paddings retrieval, to reduce the amount of changes required by project maintainers to comply with the new interface methods. This change uses the Option pattern in case other customizations can be added to Layouts in the future, without changing the public API. Main motivation for this change has been Supersonic needing to copy the entire Vbox/Hbox implementation, just to add custom paddings [1]. Also related to feature request fyne-io#1031. [1] https://github.com/dweymouth/supersonic/blob/02d4082f3dae4d1d54a4384489785a5984a7a7de/ui/layouts/hboxcustompadding.go
Introduce a `LayoutOption` concept, and allow setting custom paddings for a Layout. The `BaseLayout` struct implements the default paddings retrieval, to reduce the amount of changes required by project maintainers to comply with the new interface methods. This change uses the Option pattern in case other customizations can be added to Layouts in the future, without changing the public API. Main motivation for this change has been Supersonic needing to copy the entire Vbox/Hbox implementation, just to add custom paddings [1]. Also related to feature request fyne-io#1031. [1] https://github.com/dweymouth/supersonic/blob/02d4082f3dae4d1d54a4384489785a5984a7a7de/ui/layouts/hboxcustompadding.go
Added on develop for Fyne 2.5 |
Currently I implement a canvas object for rich text which will use a very limited subset of HTML for styling. And I struggle with the horizontal box layout, since it uses a theme padding, but I don't need any padding. Is there a way to reuse existing layout with no padding without changing the theme globally? Thanks in advance.
The text was updated successfully, but these errors were encountered: