File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
complete/tremolo_plugin/include/Tremolo Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,11 @@ class MessageOnClick : private juce::MouseListener {
66 MessageOnClick (juce::Component& topLevelComponent,
77 juce::Component& clickTarget,
88 juce::String messageOnClick)
9- : target{clickTarget}, message{std::move (messageOnClick)} {
9+ : parent{topLevelComponent},
10+ target{clickTarget},
11+ message{std::move (messageOnClick)} {
1012 popup.setAllowedPlacement (juce::BubbleComponent::BubblePlacement::below);
1113 popup.setAlwaysOnTop (true );
12- topLevelComponent.addChildComponent (popup);
1314
1415 message.setColour (
1516 CustomLookAndFeel::getColor (CustomLookAndFeel::Colors::paleBlue));
@@ -24,11 +25,15 @@ class MessageOnClick : private juce::MouseListener {
2425
2526private:
2627 void displayPopup () {
28+ // only the first call to addChildComponent() has an effect
29+ parent.addChildComponent (popup);
30+
2731 if (!popup.isVisible ()) {
2832 popup.showAt (&target, message, 0 , true );
2933 }
3034 }
3135
36+ juce::Component& parent;
3237 juce::Component& target;
3338 juce::AttributedString message;
3439 juce::BubbleMessageComponent popup;
You can’t perform that action at this time.
0 commit comments