gcompris r3569 - in branches/gcomprixogoo/src: boards canal_lock-activity colors-activity gcompris railroad-activity



Author: bcoudoin
Date: Sun Oct 12 16:01:38 2008
New Revision: 3569
URL: http://svn.gnome.org/viewvc/gcompris?rev=3569&view=rev

Log:
Now the bar is centered


Modified:
   branches/gcomprixogoo/src/boards/menu2.c
   branches/gcomprixogoo/src/canal_lock-activity/canal_lock.c
   branches/gcomprixogoo/src/colors-activity/colors.c
   branches/gcomprixogoo/src/gcompris/bar.c
   branches/gcomprixogoo/src/railroad-activity/railroad.c

Modified: branches/gcomprixogoo/src/boards/menu2.c
==============================================================================
--- branches/gcomprixogoo/src/boards/menu2.c	(original)
+++ branches/gcomprixogoo/src/boards/menu2.c	Sun Oct 12 16:01:38 2008
@@ -224,9 +224,9 @@
       gcomprisBoard->maxlevel=1;
 
       /* Set back the bar to it's original location */
-      gc_bar_location (-1, -1, -1);
       gc_bar_set(GC_BAR_CONFIG|GC_BAR_ABOUT);
       gc_bar_set_level(gcomprisBoard);
+      gc_bar_location (-1, -1, -1);
 
 
       menuitems = g_new(MenuItems, 1);

Modified: branches/gcomprixogoo/src/canal_lock-activity/canal_lock.c
==============================================================================
--- branches/gcomprixogoo/src/canal_lock-activity/canal_lock.c	(original)
+++ branches/gcomprixogoo/src/canal_lock-activity/canal_lock.c	Sun Oct 12 16:01:38 2008
@@ -168,7 +168,7 @@
       canal_lock_next_level();
 
       gc_bar_set(0);
-      gc_bar_location(0, -1, 0.7);
+      gc_bar_location(5, -1, -1);
 
       animation = FALSE;
 

Modified: branches/gcomprixogoo/src/colors-activity/colors.c
==============================================================================
--- branches/gcomprixogoo/src/colors-activity/colors.c	(original)
+++ branches/gcomprixogoo/src/colors-activity/colors.c	Sun Oct 12 16:01:38 2008
@@ -245,7 +245,7 @@
     } else {
       gc_bar_set(GC_BAR_CONFIG);
     }
-    gc_bar_location(0, -1, 0.7);
+    gc_bar_location(5, -1, 0.8);
 
     gamewon = FALSE;
 

Modified: branches/gcomprixogoo/src/gcompris/bar.c
==============================================================================
--- branches/gcomprixogoo/src/gcompris/bar.c	(original)
+++ branches/gcomprixogoo/src/gcompris/bar.c	Sun Oct 12 16:01:38 2008
@@ -59,7 +59,6 @@
 static gboolean _hidden;     /* Dialog boxes request a bar hide */
 
 /* Default position for the bar */
-static int _default_x;
 static int _default_y;
 static int _default_zoom;
 
@@ -158,14 +157,12 @@
 
   height = BARHEIGHT-2;
 
-  _default_x = BOARDWIDTH/2;
   _default_y = BOARDHEIGHT - BARHEIGHT;
   _default_zoom = 1.0;
 
   bar_reset_sound_id();
 
   rootitem = goo_canvas_group_new (goo_canvas_get_root_item(theCanvas), NULL);
-  goo_canvas_item_translate(rootitem, _default_x, _default_y);
 
   pixmap = gc_skin_pixmap_load("bar_bg.png");
   bar_item = goo_canvas_image_new (rootitem,
@@ -335,9 +332,11 @@
   ny += BARHEIGHT - (zoom == -1 ? _default_zoom : zoom) * BARHEIGHT;
 
   goo_canvas_item_set_transform(rootitem, NULL);
-  goo_canvas_item_translate(rootitem,
-			    (x == -1 ? _default_x : x),
-			    y = ny);
+
+  GooCanvasBounds bounds;
+  goo_canvas_item_get_bounds(rootitem, &bounds);
+  int nx = (x == -1 ? (BOARDWIDTH - bounds.x2 - bounds.x1)/2 : x);
+  goo_canvas_item_translate(rootitem, nx, ny);
   goo_canvas_item_scale(rootitem,
 			(zoom == -1 ? _default_zoom : zoom),
 			(zoom == -1 ? _default_zoom : zoom));

Modified: branches/gcomprixogoo/src/railroad-activity/railroad.c
==============================================================================
--- branches/gcomprixogoo/src/railroad-activity/railroad.c	(original)
+++ branches/gcomprixogoo/src/railroad-activity/railroad.c	Sun Oct 12 16:01:38 2008
@@ -187,7 +187,7 @@
       } else {
 	gc_bar_set(GC_BAR_LEVEL|GC_BAR_REPEAT);
       }
-      gc_bar_location(BOARDWIDTH-200, 0, 0.7);
+      gc_bar_location(BOARDWIDTH-160, 3, 0.7);
 
       railroad_next_level();
 



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