Fix slight issues when clicking on menu section buttons and missing isMouseInside in MouseEnter action for buttons

This commit is contained in:
Simon Robertshaw 2012-05-23 19:49:44 +01:00
parent f1953603c0
commit f41ab864ef
2 changed files with 6 additions and 0 deletions

View File

@ -242,6 +242,10 @@ public:
{ {
v->c->SetActiveMenu(menu); v->c->SetActiveMenu(menu);
} }
void ActionCallback(ui::Button * sender)
{
MouseEnterCallback(sender);
}
}; };
class GameView::ToolAction: public ui::ButtonAction class GameView::ToolAction: public ui::ButtonAction

View File

@ -136,12 +136,14 @@ void Button::OnMouseClick(int x, int y, unsigned int button)
void Button::OnMouseEnter(int x, int y) void Button::OnMouseEnter(int x, int y)
{ {
isMouseInside = true;
if(!Enabled) if(!Enabled)
return; return;
if(actionCallback) if(actionCallback)
actionCallback->MouseEnterCallback(this); actionCallback->MouseEnterCallback(this);
} }
void Button::OnMouseLeave(int x, int y) void Button::OnMouseLeave(int x, int y)
{ {
isMouseInside = false; isMouseInside = false;