Hi!
I'm trying to implement my custom menu bar. I created MenuBarComponent object and have set my custom MenuBarModel for it.
For now I want to add some custom look to the menu bar, it's just simple, to change background of item by mouseOver.
I implemented something like that:
void MenuLookAndFeel::drawMenuBarItem (Graphics& g,
int width,
int height,
int itemIndex,
const String& itemText,
bool isMouseOverItem,
bool isMenuOpen,
bool isMouseOverBar,
MenuBarComponent& menuBarComponent)
{
if (isMouseOverItem)
{
g.setColour (Colours::green);
}
else
{
g.setColour (Colours::red);
}
g.fillRect (0, 0, width, height);
g.setColour (Colours::white);
g.drawText (itemText, 0, 0, width, height, Justification::centred, false);
}
But all my items (i.e "File", "Edit", "Options" etc.) get filled with this colour, and I want the only one (i.e "File") item will change it's background by mouseOver action.
Would you be so kind to help me to solve that problem? Seem like I'm doing something wrong.
Thanks in advance :)
