im.pidgin.pidgin: 777b92c3aa5b0886b34c80a50a7e8e08f735894d

sadrul at pidgin.im sadrul at pidgin.im
Sun Feb 17 12:25:43 EST 2008


-----------------------------------------------------------------
Revision: 777b92c3aa5b0886b34c80a50a7e8e08f735894d
Ancestor: a78afdf6c360dacd4a5e5b5a866f3d6996815d46
Author: sadrul at pidgin.im
Date: 2008-02-17T17:26:37
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/777b92c3aa5b0886b34c80a50a7e8e08f735894d

Modified files:
        finch/libgnt/gntmenu.c

ChangeLog: 

Single clicking a menuitem should activate it.

-------------- next part --------------
============================================================
--- finch/libgnt/gntmenu.c	847190bb8f0f653dd972e35e28f1284135861834
+++ finch/libgnt/gntmenu.c	49a42b604cbcc4cedd3a3b258596b127a93edeab
@@ -46,6 +46,7 @@ static gboolean (*org_key_pressed)(GntWi
 static void (*org_map)(GntWidget *wid);
 static void (*org_size_request)(GntWidget *wid);
 static gboolean (*org_key_pressed)(GntWidget *w, const char *t);
+static gboolean (*org_clicked)(GntWidget *w, GntMouseEvent event, int x, int y);
 
 static void menuitem_activate(GntMenu *menu, GntMenuItem *item);
 
@@ -390,6 +391,16 @@ gnt_menu_hide(GntWidget *widget)
 		menu->parentmenu->submenu = NULL;
 }
 
+static gboolean
+gnt_menu_clicked(GntWidget *widget, GntMouseEvent event, int x, int y)
+{
+	if (!org_clicked || !org_clicked(widget, event, x, y) ||
+			!GNT_MENU(widget)->type == GNT_MENU_TOPLEVEL)
+			return FALSE;
+	gnt_widget_activate(widget);
+	return TRUE;
+}
+
 static void
 gnt_menu_class_init(GntMenuClass *klass)
 {
@@ -401,6 +412,7 @@ gnt_menu_class_init(GntMenuClass *klass)
 	org_draw = wid_class->draw;
 	org_key_pressed = wid_class->key_pressed;
 	org_size_request = wid_class->size_request;
+	org_clicked = wid_class->clicked;
 
 	wid_class->destroy = gnt_menu_destroy;
 	wid_class->draw = gnt_menu_draw;
@@ -409,6 +421,7 @@ gnt_menu_class_init(GntMenuClass *klass)
 	wid_class->key_pressed = gnt_menu_key_pressed;
 	wid_class->activate = gnt_menu_activate;
 	wid_class->hide = gnt_menu_hide;
+	wid_class->clicked = gnt_menu_clicked;
 
 	parent_class->toggled = gnt_menu_toggled;
 


More information about the Commits mailing list