When calculating implicitWidth, also check the value of the heading. Give footerToolbar some padding to make sure it does not portrude over the dialog itself.