[i88i] GUI refactoring: reduce code duplication ()

Merging branch 'i88i'  into 'main'.

See merge request !959
5 jobs for main in 5 minutes and 46 seconds (queued for 3 seconds)