2

I'm currently developing a MacOS menubar app and my NSPopover is fairly wide (450 pixels). Because of its width, it clips off screen if the user doesn't have other MenuBar Items taking space (See image below for visual example).

Here's my code for adding the popover to the screen:

popover?.show(relativeTo: statusBarButton!.bounds, of: (statusBarButton)!, preferredEdge: .minY)

I've already tried the answer suggested here: https://stackoverflow.com/a/48604455/13949789. The problem is that the arrow doesn't follow, creating a very odd look (See image below for visual example).

Good location, but the arrow's at the wrong spot (Uses suggestion from other post):

Bad location, but the arrow's at the right spot:

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Jeremy
  • 21
  • 2

0 Answers0