fix and improve CustomCheckbox (plus avoiding painter error messages)