Fixes #1483, issues with repaint on buttons