StackLayout spacing / padding fix

The code could use some cleanup but is working as discussed in issue
#2750