Closed dlight closed 4 years ago
It would be useful if ui::core::Style::padding
could optionally add different amounts of padding to each side, like css - and have it exposed to each widget (letting the user either set the same amount for all 4 sides, or different amounts)
You can wrap your widget in a Column
and use Column::padding
.
A different amount of padding per side is simply not supported yet. Styling in Iced will get reworked soon.
For instance, the ui
example uses it here: https://github.com/hecrj/coffee/blob/8e2da7b229afb641b9bc99c13863d764dd461f9f/examples/ui.rs#L101
Thanks!
Is there a way to set padding around a widget like
ui::Image
orui::Text
? I see thatexamples/image.rs
,Text::height
is used to set the height in pixels (and, since this was in a column, this results in some padding if the height is larger than the computed height of the text). In the same example,Column::spacing
is used to set a constant amount of spacing between the itens of the column (but not before the first and after the last).Both aren't what I'm looking for; there's also
ui::core::Style::padding
but I'm unsure how to use this with the current widgets (is it necessary to add apadding
method to the widgets, like they have aheight
method? Shouldn't those methods be added to a trait?).(ps: since the ui code is being moved to iced perhaps this issue belongs there, but coffee doesn't used iced yet)