gui: handle focus_in|out to update chain picture
improve display of code