[gnome-control-center] shell: Fix keyboard focus in animated notebook



commit 359f029419d0c7962ae2afc04c7fd1d569897c5f
Author: Bastien Nocera <hadess hadess net>
Date:   Tue May 22 18:19:39 2012 +0100

    shell: Fix keyboard focus in animated notebook
    
    But just for panels, the main overview is still sub-par.

 shell/cc-notebook.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/shell/cc-notebook.c b/shell/cc-notebook.c
index 84dd833..16bad06 100644
--- a/shell/cc-notebook.c
+++ b/shell/cc-notebook.c
@@ -243,6 +243,24 @@ cc_notebook_get_preferred_height_for_width (GtkWidget       *widget,
 	}
 }
 
+static gboolean
+cc_notebook_focus (GtkWidget        *widget,
+		   GtkDirectionType  direction)
+{
+	CcNotebook *notebook;
+	GtkWidget *child;
+
+	notebook = CC_NOTEBOOK (widget);
+	child = notebook->priv->selected_page;
+
+	if (child == NULL)
+		return FALSE;
+
+	/* HACK: the default GtkContainer implementation is fine by us
+	 * and there's no way to get to it without excessive copy/paste */
+	return GTK_WIDGET_GET_CLASS (child)->focus (child, direction);
+}
+
 static void
 cc_notebook_class_init (CcNotebookClass *klass)
 {
@@ -267,6 +285,7 @@ cc_notebook_class_init (CcNotebookClass *klass)
 	widget_class->get_preferred_width_for_height = cc_notebook_get_preferred_width_for_height;
 	widget_class->get_preferred_width = cc_notebook_get_preferred_width;
 	widget_class->get_preferred_height_for_width = cc_notebook_get_preferred_height_for_width;
+	widget_class->focus = cc_notebook_focus;
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]