Move setMask() calls from paintEvent() to resizeEvent()
Mask doesn't change otherwise, and it might even be too late to
apply it without some duplicate rendering.
Also set border width before resize to not force double repaint for
correct rendering, and don't mimic resize by forcing min/max values.