Open codecat opened 8 years ago
I actually just realized it doesn't work for padding
because the padding is handled at inflate-time. So that would also ultimately require a reload of all widgets.
Yes, true. The simple layout that non-TBLayout widgets do, cannot reapply padding like it does when inflated. This is because it doesn't know the difference between widgets that should, and widgets that was given some custom rect programmatically that shouldn't be overwritten.
I think that in the long run, it would be better to always reapply padding & gravity in situations like that (it's also a problem when using strong override with different padding on non-TBLayout layouts). And have a special layout widget (or flag) for when widgets are given custom rects. That should be a rare special case anyway.
I'll push a fix to shape-rasterizer-3, that makes TBSkin::Load callable multiple times btw. I'll use it to change theme. Same skin and paddings, but with different set of colors.
Thanks for the clarification!
What's the best way to reload a skin at runtime? Currently, I'm using this:
This works for colors and such, but not for
padding
for some reason. Also, would this work on the new shape-based skin system?