minimizing to tray and fix tab/space mix

the minimizing behavior is the same as https://tn123.org/mintrayr/

close button (the x) end the program
minimize button (the one that look like a - in most os), minimize to tray