Improve styles in legend panel

Fix #580