[gcompris] minor: improved the display of a potential sponsor.



commit 0c1788a7640214ef35f9eb5f1904122a3cd5a6b7
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Thu May 17 12:38:33 2012 +0200

    minor: improved the display of a potential sponsor.

 src/boards/menu2.c   |   30 +++++++++++++++++++++++++++++-
 src/gcompris/about.c |   13 ++-----------
 2 files changed, 31 insertions(+), 12 deletions(-)
---
diff --git a/src/boards/menu2.c b/src/boards/menu2.c
index d19fb25..9ad0c7b 100644
--- a/src/boards/menu2.c
+++ b/src/boards/menu2.c
@@ -893,6 +893,33 @@ display_welcome_event (GooCanvasItem  *item,
   return FALSE;
 }
 
+static void display_sponsor(GooCanvasItem *rootitem)
+{
+  GooCanvasItem *item;
+  GdkPixbuf   *pixmap = NULL;
+  /* Location for a potential sponsor */
+  gchar *sponsor_image = gc_file_find_absolute("sponsor.png");
+  if(sponsor_image)
+    {
+      pixmap = gc_pixmap_load("sponsor.png");
+      item = goo_canvas_image_new (rootitem,
+				   pixmap,
+				   0.0,
+				   0.0,
+				   NULL);
+      SET_ITEM_LOCATION_CENTER(item,
+			       display_x + display_w/2.0,
+			       display_y + display_h/3.0 + 150);
+
+#if GDK_PIXBUF_MAJOR <= 2 && GDK_PIXBUF_MINOR <= 24
+      gdk_pixbuf_unref(pixmap);
+#else
+      g_object_unref(pixmap);
+#endif
+      g_free(sponsor_image);
+    }
+}
+
 static void
 display_welcome (MenuItems *menuitems)
 {
@@ -913,8 +940,9 @@ display_welcome (MenuItems *menuitems)
 			     NULL);
   SET_ITEM_LOCATION_CENTER(item,
 			   display_x + display_w/2.0,
-			   display_y + display_h/3.0)
+			   display_y + display_h/3.0);
 
+  display_sponsor(actualSectionItem);
 
   g_signal_connect (item, "enter_notify_event",
 		    (GCallback) display_welcome_event, menuitems);
diff --git a/src/gcompris/about.c b/src/gcompris/about.c
index f938900..3279e26 100644
--- a/src/gcompris/about.c
+++ b/src/gcompris/about.c
@@ -135,10 +135,10 @@ void gc_about_start ()
 
   y_start += 180;
   /* Location for a potential sponsor */
-  gchar *sponsor_image = gc_file_find_absolute("sponsor.png");
+  gchar *sponsor_image = gc_file_find_absolute("sponsor_about.png");
   if(sponsor_image)
     {
-      pixmap = gc_pixmap_load("sponsor.png");
+      pixmap = gc_pixmap_load("sponsor_about.png");
       goo_canvas_text_new (rootitem,
 			   "Version parrainÃe par",
 			   (gdouble)  BOARDWIDTH*0.75,
@@ -148,15 +148,6 @@ void gc_about_start ()
 			   "font", gc_skin_font_content,
 			   "fill-color-rgba", gc_skin_color_content,
 			   NULL);
-      goo_canvas_text_new (rootitem,
-			   "Version parrainÃe par",
-			   (gdouble)  BOARDWIDTH*0.75 + 1,
-			   (gdouble)  y_start - gdk_pixbuf_get_height(pixmap),
-			   -1,
-			   GTK_ANCHOR_CENTER,
-			   "font", gc_skin_font_content,
-			   "fill_color", "black",
-			   NULL);
 
       item = goo_canvas_image_new (rootitem,
 				   pixmap,



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