mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Merge 7455c19a43 into 457cf9ecef
This commit is contained in:
commit
483241c314
2 changed files with 6 additions and 1 deletions
|
|
@ -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)
|
ItemComponent (const PopupMenu::Item& i, const PopupMenu::Options& o, MenuWindow& parent)
|
||||||
: item (i), parentWindow (parent), options (o), customComp (i.customComponent)
|
: item (i), parentWindow (parent), options (o), customComp (i.customComponent)
|
||||||
{
|
{
|
||||||
|
SettableTooltipClient::setTooltip(item.tooltipText);
|
||||||
|
|
||||||
if (item.isSectionHeader)
|
if (item.isSectionHeader)
|
||||||
{
|
{
|
||||||
customComp = *new HeaderItemComponent (item.text, options);
|
customComp = *new HeaderItemComponent (item.text, options);
|
||||||
|
|
@ -1737,6 +1739,7 @@ PopupMenu::Item& PopupMenu::Item::operator= (Item&&) = default;
|
||||||
|
|
||||||
PopupMenu::Item::Item (const Item& other)
|
PopupMenu::Item::Item (const Item& other)
|
||||||
: text (other.text),
|
: text (other.text),
|
||||||
|
tooltipText(other.tooltipText),
|
||||||
itemID (other.itemID),
|
itemID (other.itemID),
|
||||||
action (other.action),
|
action (other.action),
|
||||||
subMenu (createCopyIfNotNull (other.subMenu.get())),
|
subMenu (createCopyIfNotNull (other.subMenu.get())),
|
||||||
|
|
@ -1756,6 +1759,7 @@ PopupMenu::Item::Item (const Item& other)
|
||||||
PopupMenu::Item& PopupMenu::Item::operator= (const Item& other)
|
PopupMenu::Item& PopupMenu::Item::operator= (const Item& other)
|
||||||
{
|
{
|
||||||
text = other.text;
|
text = other.text;
|
||||||
|
tooltipText = other.tooltipText;
|
||||||
itemID = other.itemID;
|
itemID = other.itemID;
|
||||||
action = other.action;
|
action = other.action;
|
||||||
subMenu.reset (createCopyIfNotNull (other.subMenu.get()));
|
subMenu.reset (createCopyIfNotNull (other.subMenu.get()));
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,7 @@ public:
|
||||||
|
|
||||||
/** The menu item's name. */
|
/** The menu item's name. */
|
||||||
String text;
|
String text;
|
||||||
|
String tooltipText = "";
|
||||||
|
|
||||||
/** The menu item's ID.
|
/** The menu item's ID.
|
||||||
This must not be 0 if you want the item to be triggerable, but if you're attaching
|
This must not be 0 if you want the item to be triggerable, but if you're attaching
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue