Explorar o código

rtgui/widgets/notebook: optimize mouse event handling

No need to let children widget handle mouse event when user pressed the tab bar.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1823 bbd45198-f89e-11dd-88c7-29a3b14d5316
chaos.proton@gmail.com %!s(int64=13) %!d(string=hai) anos
pai
achega
18e5f05098
Modificáronse 1 ficheiros con 7 adicións e 6 borrados
  1. 7 6
      components/rtgui/widgets/notebook.c

+ 7 - 6
components/rtgui/widgets/notebook.c

@@ -116,15 +116,16 @@ static void _rtgui_notebook_onmouse(rtgui_notebook_t *notebook, struct rtgui_eve
 			_rtgui_notebook_draw_bar(notebook, dc);
 			_rtgui_notebook_draw_bar(notebook, dc);
 
 
 			rtgui_dc_end_drawing(dc);
 			rtgui_dc_end_drawing(dc);
-
-			return;
 		}
 		}
 	}
 	}
-
+	else
+	{
 	/* handle on page */
 	/* handle on page */
-	if (notebook->childs[notebook->current].widget->event_handler != RT_NULL)
-		notebook->childs[notebook->current].widget->event_handler(notebook->childs[notebook->current].widget,
-			&(emouse->parent));
+		if (notebook->childs[notebook->current].widget->event_handler != RT_NULL)
+			notebook->childs[notebook->current].widget->event_handler(
+					notebook->childs[notebook->current].widget,
+					&(emouse->parent));
+	}
 }
 }
 
 
 static void _rtgui_notebook_get_page_rect(rtgui_notebook_t *notebook, struct rtgui_rect* rect)
 static void _rtgui_notebook_get_page_rect(rtgui_notebook_t *notebook, struct rtgui_rect* rect)