Ported right panel gesture code from randomshit