add layout, remove painevent and fix gui responsivness when no thrig