1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-19 01:04:20 +00:00
This commit is contained in:
Gavin Burke 2025-08-17 12:47:44 +00:00 committed by GitHub
commit 1e0e2c8f05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 41 additions and 0 deletions

View file

@ -2425,6 +2425,16 @@ bool PopupMenu::MenuItemIterator::next()
return true;
}
PopupMenu::Options PopupMenu::Options::withSelectableAreaLeftInset (int xInsetAmount) const
{
return with (*this, &Options::selectableAreaLeftInset, xInsetAmount);
}
PopupMenu::Options PopupMenu::Options::withSelectableAreaRightInset (int xInsetAmount) const
{
return with (*this, &Options::selectableAreaRightInset, xInsetAmount);
}
PopupMenu::Item& PopupMenu::MenuItemIterator::getItem() const
{
jassert (currentItem != nullptr);

View file

@ -560,6 +560,37 @@ public:
/** Sets the direction of the popup menu relative to the target screen area. */
[[nodiscard]] Options withPreferredPopupDirection (PopupDirection direction) const;
/** Provide an X value from the left edge of any PopupMenu item such
that clicks to the left of the X value will NOT select the Popup
menu item, but clicks to the right will select the Popup men item.
This is useful for blocking off area for extra UI in a
PopupMenu::CustomComponent that you do not want to be used for
selecting a menu item.
@note Added by Tim for FAW SampleComboBox.h so that we could prevent
the sample audio preview buttons in the SamplePopMenuItem
from selecting the item.
*/
[[nodiscard]] Options withSelectableAreaLeftInset (int xInsetAmount) const;
/** Provide an X value from the right edge of any PopupMenu item such
that clicks to the right of the X value will NOT select the Popup
menu item, but clicks to the left will select the Popup men item.
This is useful for blocking off area for extra UI in a
PopupMenu::CustomComponent that you do not want to be used for
selecting a menu item.
@note Added by Tim for FAW SampleComboBox.h so that we could prevent
the favorite buttons in the SamplePopMenuItem from selecting
the item.
*/
[[nodiscard]] Options withSelectableAreaRightInset (int xInsetAmount) const;
/** Sets an item to select in the menu.