Post #349: 
Ok, try to add some extra code for the brush and color buttons: bl_context.set_context(C).
E.g. brush button:
bl_context.set_context(C); ps = paint_settings(bl_context); L.template_ID_preview(ps, 'brush', new='brush.add', rows=3, cols=8) if ps else None
This should fix collapse issue.
Hidden icon is a known issue. I donโt know how to fix it yet.