rtgui/widgets/notebook: optimize mouse event handling #2

No need to update tab bar when user pressed the same tab.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1824 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
chaos.proton@gmail.com 2011-12-02 15:02:25 +00:00
parent 18e5f05098
commit 538f59adaa
1 changed files with 1 additions and 1 deletions

View File

@ -105,7 +105,7 @@ static void _rtgui_notebook_onmouse(rtgui_notebook_t *notebook, struct rtgui_eve
struct rtgui_dc* dc; struct rtgui_dc* dc;
index = (emouse->x - rect.x1) / RTGUI_NOTEBOOK_TAB_WIDTH; index = (emouse->x - rect.x1) / RTGUI_NOTEBOOK_TAB_WIDTH;
if (index < notebook->count) if (index < notebook->count && index != notebook->current)
{ {
/* update tab bar */ /* update tab bar */
dc = rtgui_dc_begin_drawing(RTGUI_WIDGET(notebook)); dc = rtgui_dc_begin_drawing(RTGUI_WIDGET(notebook));