summaryrefslogtreecommitdiff
path: root/components/rtgui/widgets/notebook.c
diff options
context:
space:
mode:
author[email protected] <[email protected]>2011-12-02 15:02:25 +0000
committer[email protected] <[email protected]>2011-12-02 15:02:25 +0000
commit538f59adaaac04ae3f2b16d31fe2e2c60299174d (patch)
tree3b2bcc22cf25a408d823c8458c4d1cecc39df52f /components/rtgui/widgets/notebook.c
parent18e5f05098724f034c4ca0dd36e544b32097500e (diff)
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
Diffstat (limited to 'components/rtgui/widgets/notebook.c')
-rw-r--r--components/rtgui/widgets/notebook.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/rtgui/widgets/notebook.c b/components/rtgui/widgets/notebook.c
index 2feb3d16e0..667baa9ec2 100644
--- a/components/rtgui/widgets/notebook.c
+++ b/components/rtgui/widgets/notebook.c
@@ -105,7 +105,7 @@ static void _rtgui_notebook_onmouse(rtgui_notebook_t *notebook, struct rtgui_eve
struct rtgui_dc* dc;
index = (emouse->x - rect.x1) / RTGUI_NOTEBOOK_TAB_WIDTH;
- if (index < notebook->count)
+ if (index < notebook->count && index != notebook->current)
{
/* update tab bar */
dc = rtgui_dc_begin_drawing(RTGUI_WIDGET(notebook));