Revert "Revert the broken filters-on-the-right layout (fix #1302)"

This reverts commit 8595fb8769c7863aeafa9acfe1cf9687387c6acf.

Will try to merge it from an existing PR
Revert "Hide the filters when the user clicks on the legend field"

This reverts commit 9bb6d65fbfcd54d78d0fe39c20f64ab8186bb45c.