Hello,
I’m not sure if this warrants a feature request, as there may be another way to achieve the same outcome, however…
I am building a plugin on windows. I want to create a transparent PopupMenu. Trying to do this through any kind of LookAndFeel does not work. I suspect because the component itself is set to be opaque. Adding the call to setOpaque(false); here allows a transparent menu:
int PopupMenu::showWithOptionalCallback (const Options& options,
ModalComponentManager::Callback* userCallback,
bool canBeModal)
{
std::unique_ptr<ModalComponentManager::Callback> userCallbackDeleter (userCallback);
std::unique_ptr<PopupMenuCompletionCallback> callback (new PopupMenuCompletionCallback());
if (auto* window = createWindow (options, &(callback->managerOfChosenCommand)))
{
callback->component.reset (window);
PopupMenuSettings::menuWasHiddenBecauseOfAppChange = false;
window->setVisible (true); // (must be called before enterModalState on Windows to avoid DropShadower confusion)
window->setOpaque(false);
window->enterModalState (false, userCallbackDeleter.release());
ModalComponentManager::getInstance()->attachCallback (window, callback.release());
window->toFront (false); // need to do this after making it modal, or it could
// be stuck behind other comps that are already modal..
#if JUCE_MODAL_LOOPS_PERMITTED
if (userCallback == nullptr && canBeModal)
return window->runModalLoop();
#else
ignoreUnused (canBeModal);
jassert (! (userCallback == nullptr && canBeModal));
#endif
}
return 0;
}
Would it be possible to get a call to a popup menu directly for this, eg:
juce::PopupMenu menu;
menu.setOpaque(false);
Or similar?
Thanks for reading!