1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

PopupMenu header ID fix.

This commit is contained in:
jules 2013-05-15 11:15:17 -06:00
parent 334ad5a51a
commit 79d26045bb

View file

@ -23,6 +23,18 @@
==============================================================================
*/
//==============================================================================
namespace PopupMenuSettings
{
const int scrollZone = 24;
const int borderSize = 2;
const int timerInterval = 50;
const int dismissCommandId = 0x6287345f;
const int sectionHeaderID = 0x4734a34f;
static bool menuWasHiddenBecauseOfAppChange = false;
}
class PopupMenu::Item
{
public:
@ -87,7 +99,7 @@ public:
commandManager (other.commandManager)
{}
bool canBeTriggered() const noexcept { return isActive && itemID != 0; }
bool canBeTriggered() const noexcept { return isActive && itemID != 0 && itemID != PopupMenuSettings::sectionHeaderID; }
bool hasActiveSubMenu() const noexcept { return isActive && subMenu != nullptr && subMenu->items.size() > 0; }
//==============================================================================
@ -199,17 +211,6 @@ private:
};
//==============================================================================
namespace PopupMenuSettings
{
const int scrollZone = 24;
const int borderSize = 2;
const int timerInterval = 50;
const int dismissCommandId = 0x6287345f;
static bool menuWasHiddenBecauseOfAppChange = false;
}
//==============================================================================
class PopupMenu::Window : public Component,
private Timer
@ -1330,7 +1331,7 @@ private:
void PopupMenu::addSectionHeader (const String& title)
{
addCustomItem (0X4734a34f, new HeaderItemComponent (title));
addCustomItem (PopupMenuSettings::sectionHeaderID, new HeaderItemComponent (title));
}
//==============================================================================