Fix bug 819578, Default styles in panels should only be applied once

Resubmitting PR