Factorize preview drawing
Merge branch 'ui' of https://github.com/SharUTC/SharUTC into ui