gui: Don't compute string length unnecessarily.