before chainging main_window
added resizing fields when changing window size