Expand tree nodes in the legend panel

A quick fix to solve the #265.
Please test it.