There was already some kind of detection and adjustment if there is not enough space for the popup available. Do some more work by placing the popup according to its PopupPlacement enum. Do this also if the popup breaks the top or left boundary of the screen.
The goal is to never hide the parentItem, but in this revision this is yet violated for Types::TopPosedRightAlignedPopup and Types::LeftPosedBottomAlignedPopup if both respective screen limits are broken. The question is if we should it ignore it or place the popup then better to the side or bottom/top.
Also fixes some minor problems:
- TopPosedRightAlignedPopup was the same as RightPosedTopAlignedPopup, but in the first case the menu should be on top of parentItem
- LeftPosedTopAlignedPopup was above parentItem and not left of it
- Small documentation error
Tested it with my WIP patch for plasma-pa: