Replace whole block by `clear_frame_button->setEnabled(!is_rendering);`.