Trim text for text boxes

Refs #10441
Merge branch 'feature/10441_refactor_spectrum_viewer' into develop