[gcompris/gcomprixogoo] Now when the filename is selected or the type, the focus on the icons is set.



commit c5bb7634739b3c431b6741c9fc067ac5488fe994
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Sun Nov 22 17:29:33 2009 +0100

    Now when the filename is selected or the type, the focus on the icons is set.

 src/gcompris/file_selector.c |   45 +++++++++++++++++++++++++----------------
 1 files changed, 27 insertions(+), 18 deletions(-)
---
diff --git a/src/gcompris/file_selector.c b/src/gcompris/file_selector.c
index ce7f937..63dfe91 100644
--- a/src/gcompris/file_selector.c
+++ b/src/gcompris/file_selector.c
@@ -464,42 +464,51 @@ display_files(GooCanvasItem *root_item, gchar *rootdir)
 			      "allfilename", allfilename, g_free);
       /* The type */
       if(ext)
+	{
+	  GooCanvasItem *_item = \
+	    goo_canvas_text_new (goo_canvas_get_root_item(GOO_CANVAS(canvas)),
+				 ext,
+				 ix + (IMAGE_WIDTH + IMAGE_GAP)/2,
+				 iy + 10,
+				 -1,
+				 GTK_ANCHOR_CENTER,
+				 "font", "Sans 6",
+				 "fill-color-rgba",
+				 gc_skin_get_color("gcompris/fileselectcol"),
+				 NULL);
+	  g_signal_connect(_item, "button_press_event",
+			   (GtkSignalFunc) item_event_file_selector,
+			   allfilename);
+	  gc_item_focus_init(_item, item);
+	}
+
+      /* The filename */
+      GooCanvasItem *name_item = \
 	goo_canvas_text_new (goo_canvas_get_root_item(GOO_CANVAS(canvas)),
-			     ext,
+			     file_wo_ext,
 			     ix + (IMAGE_WIDTH + IMAGE_GAP)/2,
-			     iy + 10,
+			     iy + IMAGE_HEIGHT - 30,
 			     -1,
 			     GTK_ANCHOR_CENTER,
-			     "font", "Sans 6",
-			     "fill-color-rgba",
-			     gc_skin_get_color("gcompris/fileselectcol"),
+			     "font", "Sans 7",
+			     "fill-color-rgba", gc_skin_get_color("gcompris/fileselectcol"),
 			     NULL);
-
-      /* The filename */
-      item = goo_canvas_text_new (goo_canvas_get_root_item(GOO_CANVAS(canvas)),
-				  file_wo_ext,
-				  ix + (IMAGE_WIDTH + IMAGE_GAP)/2,
-				  iy + IMAGE_HEIGHT - 30,
-				  -1,
-				  GTK_ANCHOR_CENTER,
-				  "font", "Sans 7",
-				  "fill-color-rgba", gc_skin_get_color("gcompris/fileselectcol"),
-				  NULL);
       g_free(file_wo_ext);
       g_free(filename);
 
       if(g_file_test(allfilename, G_FILE_TEST_IS_DIR))
 	{
-	  g_signal_connect(item, "button_press_event",
+	  g_signal_connect(name_item, "button_press_event",
 			   (GtkSignalFunc) item_event_directory,
 			   allfilename);
 	}
       else
 	{
-	  g_signal_connect(item, "button_press_event",
+	  g_signal_connect(name_item, "button_press_event",
 			   (GtkSignalFunc) item_event_file_selector,
 			   allfilename);
 	}
+      gc_item_focus_init(name_item, item);
 
       ix += IMAGE_WIDTH + IMAGE_GAP;
 



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