A suggestion for dropshadows and popupmenus


#1

Right now I am implementing my own top level menubar and am having a problem.

Essentialy I am using a custom button as the toplevel menu widget, which when pressed shows a popupmenu.

The problem is that the dropshadow that is created for a popupmenu goes all the way around the rectangle. The top portion then gets faded over the menu “button” right above the popup menu, causing an uneven rendered area.

What I am suggesting is that the dropshadow class be refactored to allow you to specify which borders of the component it should show a shadow for.

Furthermore, this is a problem with popupmenus since you can’t get to the underlying native window (popupmenuwindow) that it uses. I had to hack a bit at nativedesktopwindow, and popupmenu and dropshadower in order to let me assign the popupmenu my own custom drop shadower.

It would be good if you can tell a popup menu what its purpose is, either to be used as a right click popup, or as a root level (in which case the drop shadow should not exist on the top border, just the left, right and bottom).

Hope this feedback is useful.

JUCE is wonderful so far.


#2

Yes, I’ve had the same thought myself. I was thinking of adding a special case to the popup to let you attach it to a button/component, so would have to tweak the shadows for that.


#3

That would be great. Because the other problem is making sure the popupmenu shows up directly flush with the bottom/leftmost part of the button. I am currently using the button’s screenX and screenY, but its flaky, seems as if when the dialogwindow is far to the right of the screen, the menu shows up far to the left of the button, almost as if after the window was moved the screenX/Y was not updated.

I can’t figure out why this is happening.


#4