Some of the built-in widgets have part of their style hard-coded, like height.
We should be able to move this logic into the Renderer trait of each widget. Now, there are different ways of doing this:
Renderer::HEIGHTRenderer::heightRenderer::styleWe should think about the pros and cons of each before proceeding. Also, feel free to suggest new ideas!
"Constants" and "simple methods" both assume the fields that a renderer is allowed to decorate. It's possible that a back-end has some sort of weird requirement, on colors or size for example.
In my opinion, the most flexible solution is to provide a decorator for a provided style on each renderer.
Do you want me to have a go at implementing this ?
At first, the built-in widgets were meant to be more of a guideline to build your own custom toolkit. However, I am currently in the middle of some redesign that will affect this (widgets won't contain a direct Style), and I think providing reusable and flexible built-in widgets will be very valuable, as you say.
Do you want me to have a go at implementing this ?
I am already working on this, but I really appreciate the will to help! I will open a PR soon, I'd be glad to receive your feedback there.
As soon as the PR is opened, be sure to reference it here so I get the notification by mail. I will gladly review it :)
@AlisCode Sorry for the delay! The last couple of weeks have been pretty intense for me :)
I have opened a PR that should tackle this issue: #17. There are a lot of changes there, as I have been redesigning the crate a bit. Let me know if you have any questions!
I have been busy too but I now have time ; I will read the PR and give you some comments :)