Calculate dialog header width correctly