File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -120,11 +120,13 @@ struct HeaderItemComponent final : public PopupMenu::CustomComponent
120120};
121121
122122// ==============================================================================
123- struct ItemComponent final : public Component
123+ struct ItemComponent final : public Component, public SettableTooltipClient
124124{
125125 ItemComponent (const PopupMenu::Item& i, const PopupMenu::Options& o, MenuWindow& parent)
126126 : item (i), parentWindow (parent), options (o), customComp (i.customComponent)
127127 {
128+ SettableTooltipClient::setTooltip (item.tooltipText );
129+
128130 if (item.isSectionHeader )
129131 customComp = *new HeaderItemComponent (item.text , options);
130132
@@ -1708,6 +1710,7 @@ PopupMenu::Item& PopupMenu::Item::operator= (Item&&) = default;
17081710
17091711PopupMenu::Item::Item (const Item& other)
17101712 : text (other.text),
1713+ tooltipText (other.tooltipText),
17111714 itemID (other.itemID),
17121715 action (other.action),
17131716 subMenu (createCopyIfNotNull (other.subMenu.get())),
@@ -1727,6 +1730,7 @@ PopupMenu::Item::Item (const Item& other)
17271730PopupMenu::Item& PopupMenu::Item::operator = (const Item& other)
17281731{
17291732 text = other.text ;
1733+ tooltipText = other.tooltipText ;
17301734 itemID = other.itemID ;
17311735 action = other.action ;
17321736 subMenu.reset (createCopyIfNotNull (other.subMenu .get ()));
Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ class JUCE_API PopupMenu
137137
138138 /* * The menu item's name. */
139139 String text;
140+ String tooltipText = " " ;
140141
141142 /* * The menu item's ID.
142143 This must not be 0 if you want the item to be triggerable, but if you're attaching
You can’t perform that action at this time.
0 commit comments