Enable reverse order for legend. Set by default

In the layer list in the map layers, the first added elements are the one below the other layers. On the legend panel, this order is the same.
I would expect for legend the opposite : getting the 'base' layers below instead of being at the top.
I submit a patch to be able to choose to keep order or reverse it.
Ready to discuss