Fix menu height for alternate layouts and themes

The applet popup menu was still overflowing the window on some themes. This fixes the max height by taking into account the theme-set gap between the menu and the panel, as well as a second panel if there is one.