private void UpdateState(int x, int y) { Theme.MenuItemState newState; if(Menu != null && Action != null && arrowAllocation.Contains (x, y)) { newState = Theme.MenuItemState.HilightMenu; } else if(menuOpened || Action == null) { newState = Theme.MenuItemState.Hilight; } else { newState = Theme.MenuItemState.HilightAction; } if(state != newState) { if(newState == Theme.MenuItemState.Hilight || newState == Theme.MenuItemState.HilightMenu) timer.Change (openTimeoutSec, new TimeSpan (-1)); else timer.Change (-1, -1); state = newState; this.QueueDraw (); } }
protected override bool OnLeaveNotifyEvent(Gdk.EventCrossing evnt) { timer.Change (-1, -1); bool ret = base.OnLeaveNotifyEvent (evnt); state = Theme.MenuItemState.Default; this.QueueDraw (); return ret; }