Arrange widgets in viewport

First picture shows how its done in path of exile, second shows how it looks like in my project lol, i tried alot of differend things to get this done, but it didnt work at all :confused:
I used GetCachedGeometry().GetClippingRect() to get corners and GetCachedGeometry().IsUnderLocation() to find out if widgets covers each other, but i just dont understand whut to do next.