changeset 27099:48bfcbe20b11

merge of '86d7e4c199cf2a62e48fd6fe79e35e3c80cc7926' and 'ddd8012e657f100977759e1d1312576b04b464b9'
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 11 Jun 2009 05:07:15 +0000
parents 28b5fcfb7444 (current diff) d679d47c82be (diff)
children 710cb8df1b69
files
diffstat 6 files changed, 64 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Wed Jun 10 07:44:35 2009 +0000
+++ b/COPYRIGHT	Thu Jun 11 05:07:15 2009 +0000
@@ -510,6 +510,7 @@
 Ma Xuan
 Jared Yanovich
 Timmy Yee
+Li Yuan
 Nickolai Zeldovich
 Tom Zickel
 Marco Ziech
--- a/ChangeLog	Wed Jun 10 07:44:35 2009 +0000
+++ b/ChangeLog	Thu Jun 11 05:07:15 2009 +0000
@@ -99,6 +99,7 @@
 	  collapse buddy groups or contacts. (Peter Ruibal)
 	* Support saving animated custom smileys as animated images or animated
 	  custom smileys. (Andrea Piccinelli)
+	* Support for keyboard navigation on the status icon. (Li Yuan)
 
 	Finch:
 	* The hardware cursor is updated correctly. This will be useful
--- a/pidgin/eggtrayicon.c	Wed Jun 10 07:44:35 2009 +0000
+++ b/pidgin/eggtrayicon.c	Thu Jun 11 05:07:15 2009 +0000
@@ -400,9 +400,35 @@
 static gboolean
 transparent_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
 {
-	gdk_window_clear_area (widget->window, event->area.x, event->area.y,
-	                      event->area.width, event->area.height);
-	return FALSE;
+  GtkWidget *focus_child = NULL;
+  gint border_width, x, y, width, height;
+  gboolean retval = FALSE;
+
+  gdk_window_clear_area (widget->window, event->area.x, event->area.y,
+                         event->area.width, event->area.height);
+
+  if (GTK_WIDGET_CLASS (parent_class)->expose_event)
+    retval = GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
+
+  if (GTK_CONTAINER (widget)->focus_child)
+    focus_child = GTK_CONTAINER (GTK_CONTAINER (widget)->focus_child)->focus_child;
+  if (focus_child && GTK_WIDGET_HAS_FOCUS (focus_child))
+    {
+      border_width = GTK_CONTAINER (widget)->border_width;
+
+      x = widget->allocation.x + border_width;
+      y = widget->allocation.y + border_width;
+
+      width  = widget->allocation.width  - 2 * border_width;
+      height = widget->allocation.height - 2 * border_width;
+
+      gtk_paint_focus (widget->style, widget->window,
+                       GTK_WIDGET_STATE (widget),
+                       &event->area, widget, "tray_icon",
+                       x, y, width, height);
+    }
+
+  return retval;
 }
 
 static void
--- a/pidgin/gtkdocklet-x11.c	Wed Jun 10 07:44:35 2009 +0000
+++ b/pidgin/gtkdocklet-x11.c	Thu Jun 11 05:07:15 2009 +0000
@@ -32,6 +32,7 @@
 
 #include "eggtrayicon.h"
 #include "gtkdocklet.h"
+#include <gdk/gdkkeysyms.h>
 
 #define SHORT_EMBED_TIMEOUT 5000
 #define LONG_EMBED_TIMEOUT 15000
@@ -89,6 +90,33 @@
 	return TRUE;
 }
 
+static gboolean
+docklet_x11_pressed_cb(GtkWidget *button, GdkEventKey *event)
+{
+	guint state, keyval;
+
+	state = event->state & gtk_accelerator_get_default_mod_mask();
+	keyval = event->keyval;
+	if (state == 0 &&
+	    (keyval == GDK_Return ||
+	     keyval == GDK_KP_Enter ||
+	     keyval == GDK_ISO_Enter ||
+	     keyval == GDK_space ||
+	     keyval == GDK_KP_Space))
+	{
+		pidgin_docklet_clicked(1);
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+static void
+docklet_x11_popup_cb(GtkWidget *button)
+{
+	pidgin_docklet_clicked(3);
+}
+
 static void
 docklet_x11_update_icon(PurpleStatusPrimitive status, gboolean connecting, gboolean pending)
 {
@@ -259,11 +287,14 @@
 	docklet = egg_tray_icon_new(PIDGIN_NAME);
 	box = gtk_event_box_new();
 	image = gtk_image_new();
+	GTK_WIDGET_SET_FLAGS (image, GTK_CAN_FOCUS);
 
 	g_signal_connect(G_OBJECT(docklet), "embedded", G_CALLBACK(docklet_x11_embedded_cb), NULL);
 	g_signal_connect(G_OBJECT(docklet), "destroy", G_CALLBACK(docklet_x11_destroyed_cb), NULL);
 	g_signal_connect(G_OBJECT(docklet), "size-allocate", G_CALLBACK(docklet_x11_resize_icon), NULL);
 	g_signal_connect(G_OBJECT(box), "button-press-event", G_CALLBACK(docklet_x11_clicked_cb), NULL);
+	g_signal_connect(G_OBJECT(box), "key-press-event", G_CALLBACK(docklet_x11_pressed_cb), NULL);
+	g_signal_connect(G_OBJECT(box), "popup-menu", G_CALLBACK(docklet_x11_popup_cb), NULL);
 	gtk_container_add(GTK_CONTAINER(box), image);
 	gtk_container_add(GTK_CONTAINER(docklet), box);
 
--- a/pidgin/gtkft.c	Wed Jun 10 07:44:35 2009 +0000
+++ b/pidgin/gtkft.c	Thu Jun 11 05:07:15 2009 +0000
@@ -705,7 +705,7 @@
 	};
 
 	/* Setup the initial table */
-	dialog->table = table = gtk_table_new(G_N_ELEMENTS(labels), 2, FALSE);
+	dialog->table = table = gtk_table_new(G_N_ELEMENTS(labels) + 1, 2, FALSE);
 	gtk_table_set_row_spacings(GTK_TABLE(table), PIDGIN_HIG_BOX_SPACE);
 	gtk_table_set_col_spacings(GTK_TABLE(table), PIDGIN_HIG_BOX_SPACE);
 
--- a/pidgin/gtkicon-theme-loader.c	Wed Jun 10 07:44:35 2009 +0000
+++ b/pidgin/gtkicon-theme-loader.c	Thu Jun 11 05:07:15 2009 +0000
@@ -41,7 +41,7 @@
 	filename_full = g_build_filename(dir, "theme.xml", NULL);
 
 	if (g_file_test(filename_full, G_FILE_TEST_IS_REGULAR))
-		root_node = xmlnode_from_file(dir, "theme.xml", "sound themes", "sound-theme-loader");
+		root_node = xmlnode_from_file(dir, "theme.xml", "icon themes", "icon-theme-loader");
 
 	g_free(filename_full);
 	g_return_val_if_fail(root_node != NULL, NULL);