Mercurial > pidgin
comparison finch/libgnt/gntmenu.c @ 23343:9a7520e489f8
Fix some key-press issues on nested popup menus where pressing up/down
would scroll in the parent menu, when it's supposed to scroll in the
child menu.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Mon, 09 Jun 2008 19:34:25 +0000 |
parents | 24dfef623410 |
children | fe2d4fc77b05 |
comparison
equal
deleted
inserted
replaced
23342:6d4e4a5963f3 | 23343:9a7520e489f8 |
---|---|
281 if (menu->submenu) { | 281 if (menu->submenu) { |
282 GntMenu *sub = menu; | 282 GntMenu *sub = menu; |
283 do sub = sub->submenu; while (sub->submenu); | 283 do sub = sub->submenu; while (sub->submenu); |
284 if (gnt_widget_key_pressed(GNT_WIDGET(sub), text)) | 284 if (gnt_widget_key_pressed(GNT_WIDGET(sub), text)) |
285 return TRUE; | 285 return TRUE; |
286 if (menu->type != GNT_MENU_TOPLEVEL) | |
287 return FALSE; | |
286 } | 288 } |
287 | 289 |
288 if ((text[0] == 27 && text[1] == 0) || | 290 if ((text[0] == 27 && text[1] == 0) || |
289 (menu->type != GNT_MENU_TOPLEVEL && strcmp(text, GNT_KEY_LEFT) == 0)) { | 291 (menu->type != GNT_MENU_TOPLEVEL && strcmp(text, GNT_KEY_LEFT) == 0)) { |
290 /* Escape closes menu */ | 292 /* Escape closes menu */ |
330 if (item && item->submenu) { | 332 if (item && item->submenu) { |
331 menuitem_activate(menu, item); | 333 menuitem_activate(menu, item); |
332 return TRUE; | 334 return TRUE; |
333 } | 335 } |
334 } | 336 } |
337 if (gnt_bindable_perform_action_key(GNT_BINDABLE(widget), text)) | |
338 return TRUE; | |
335 return org_key_pressed(widget, text); | 339 return org_key_pressed(widget, text); |
336 } | 340 } |
337 | 341 |
338 return FALSE; | 342 return gnt_bindable_perform_action_key(GNT_BINDABLE(widget), text); |
339 } | 343 } |
340 | 344 |
341 static void | 345 static void |
342 gnt_menu_destroy(GntWidget *widget) | 346 gnt_menu_destroy(GntWidget *widget) |
343 { | 347 { |
432 static void | 436 static void |
433 gnt_menu_init(GTypeInstance *instance, gpointer class) | 437 gnt_menu_init(GTypeInstance *instance, gpointer class) |
434 { | 438 { |
435 GntWidget *widget = GNT_WIDGET(instance); | 439 GntWidget *widget = GNT_WIDGET(instance); |
436 GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_SHADOW | GNT_WIDGET_NO_BORDER | | 440 GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_SHADOW | GNT_WIDGET_NO_BORDER | |
437 GNT_WIDGET_CAN_TAKE_FOCUS | GNT_WIDGET_TRANSIENT); | 441 GNT_WIDGET_CAN_TAKE_FOCUS | GNT_WIDGET_TRANSIENT | GNT_WIDGET_DISABLE_ACTIONS); |
438 GNTDEBUG; | 442 GNTDEBUG; |
439 } | 443 } |
440 | 444 |
441 /****************************************************************************** | 445 /****************************************************************************** |
442 * GntMenu API | 446 * GntMenu API |