1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00
This commit is contained in:
zsliu98 2026-01-07 11:28:43 -08:00 committed by GitHub
commit 483241c314
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -120,11 +120,13 @@ struct HeaderItemComponent final : public PopupMenu::CustomComponent
};
//==============================================================================
struct ItemComponent final : public Component
struct ItemComponent final : public Component, public SettableTooltipClient
{
ItemComponent (const PopupMenu::Item& i, const PopupMenu::Options& o, MenuWindow& parent)
: item (i), parentWindow (parent), options (o), customComp (i.customComponent)
{
SettableTooltipClient::setTooltip(item.tooltipText);
if (item.isSectionHeader)
{
customComp = *new HeaderItemComponent (item.text, options);
@ -1737,6 +1739,7 @@ PopupMenu::Item& PopupMenu::Item::operator= (Item&&) = default;
PopupMenu::Item::Item (const Item& other)
: text (other.text),
tooltipText(other.tooltipText),
itemID (other.itemID),
action (other.action),
subMenu (createCopyIfNotNull (other.subMenu.get())),
@ -1756,6 +1759,7 @@ PopupMenu::Item::Item (const Item& other)
PopupMenu::Item& PopupMenu::Item::operator= (const Item& other)
{
text = other.text;
tooltipText = other.tooltipText;
itemID = other.itemID;
action = other.action;
subMenu.reset (createCopyIfNotNull (other.subMenu.get()));

View file

@ -137,6 +137,7 @@ public:
/** The menu item's name. */
String text;
String tooltipText = "";
/** The menu item's ID.
This must not be 0 if you want the item to be triggerable, but if you're attaching