[gcompris/gcomprixogoo] Better ordering of the top level activity.



commit 9896a52c15b30e2134efa9ede035c3c22b97812a
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Sat Jan 2 16:51:38 2010 +0100

    Better ordering of the top level activity.
    
    This patch forces the ordering of the top level activity group.
    Now also the difficulty level does not appear on menu icons.

 boards/algebra_group.xml.in |    1 +
 boards/algebramenu.xml.in   |    1 +
 boards/computer.xml.in      |    5 +++--
 boards/discovery.xml.in     |    1 +
 boards/experience.xml.in    |    1 +
 boards/fun.xml.in           |    1 +
 boards/geometry.xml.in      |    1 +
 boards/math.xml.in          |    1 +
 boards/miscelaneous.xml.in  |    1 +
 boards/mouse.xml.in         |    5 +++--
 boards/numeration.xml.in    |    1 +
 boards/puzzle.xml.in        |    1 +
 boards/reading.xml.in       |    1 +
 boards/strategy.xml.in      |    1 +
 src/boards/menu2.c          |   25 ++++++++++++++-----------
 15 files changed, 32 insertions(+), 15 deletions(-)
---
diff --git a/boards/algebra_group.xml.in b/boards/algebra_group.xml.in
index 39aee84..fa8414b 100644
--- a/boards/algebra_group.xml.in
+++ b/boards/algebra_group.xml.in
@@ -5,6 +5,7 @@
 	 type="menu"
 	 section="/math/algebramenu"
 	 icon="algebra_group.svg"
+	 difficulty="2"
 	 author="">
 	 <_title>Go to Algebra activities</_title>
 	 <_description>Left-click the mouse on an activity to select it.</_description>
diff --git a/boards/algebramenu.xml.in b/boards/algebramenu.xml.in
index f6d5d56..c244357 100644
--- a/boards/algebramenu.xml.in
+++ b/boards/algebramenu.xml.in
@@ -5,6 +5,7 @@
 	 type="menu"
 	 section="/math"
 	 icon="algebramenu.svg"
+	 difficulty="2"
 	 author="">
 	 <_title>Go to calculation activities</_title>
 	 <_description>Various calculation activities.</_description>
diff --git a/boards/computer.xml.in b/boards/computer.xml.in
index 19705e1..b79ab6f 100644
--- a/boards/computer.xml.in
+++ b/boards/computer.xml.in
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <GCompris>
-  <Board 
+  <Board
 	 name="computer"
-	 type="menu" 
+	 type="menu"
 	 section="/"
 	 icon="computer.svg"
+	 difficulty="1"
 	 author="">
 	 <_title>Discover the Computer</_title>
 	 <_description>Play with computer peripherals.</_description>
diff --git a/boards/discovery.xml.in b/boards/discovery.xml.in
index d8eb32b..1f486d6 100644
--- a/boards/discovery.xml.in
+++ b/boards/discovery.xml.in
@@ -5,6 +5,7 @@
 	 type="menu"
 	 section="/"
 	 icon="discovery.svg"
+	 difficulty="2"
 	 author="">
 	 <_title>Go to discovery activities</_title>
 	 <_description>Colors, sounds, memory...</_description>
diff --git a/boards/experience.xml.in b/boards/experience.xml.in
index 674356d..134da6f 100644
--- a/boards/experience.xml.in
+++ b/boards/experience.xml.in
@@ -5,6 +5,7 @@
 	 type="menu"
 	 section="/"
 	 icon="experience.svg"
+	 difficulty="7"
 	 author="">
 	 <_title>Go to experiential activities</_title>
 	 <_description>Various activities based on physical movement.</_description>
diff --git a/boards/fun.xml.in b/boards/fun.xml.in
index b5ab7c3..f1af014 100644
--- a/boards/fun.xml.in
+++ b/boards/fun.xml.in
@@ -5,6 +5,7 @@
 	 type="menu"
 	 section="/"
 	 icon="fun.svg"
+	 difficulty="4"
 	 author="">
 	 <_title>Go to Amusement activities</_title>
 	 <_description>Various fun activities.</_description>
diff --git a/boards/geometry.xml.in b/boards/geometry.xml.in
index 0b0d11c..d9b9b21 100644
--- a/boards/geometry.xml.in
+++ b/boards/geometry.xml.in
@@ -5,6 +5,7 @@
 	 type="menu"
 	 section="/math"
 	 icon="geometry.svg"
+	 difficulty="3"
 	 author="">
 	 <_title>Geometry</_title>
 	 <_description>Geometry activities.</_description>
diff --git a/boards/math.xml.in b/boards/math.xml.in
index 73925c3..006c259 100644
--- a/boards/math.xml.in
+++ b/boards/math.xml.in
@@ -4,6 +4,7 @@
 	 name="math"
 	 type="menu"
 	 section="/"
+	 difficulty="5"
 	 icon="math.svg"
 	 author="">
 	 <_title>Mathematics</_title>
diff --git a/boards/miscelaneous.xml.in b/boards/miscelaneous.xml.in
index 7ea4a90..061b375 100644
--- a/boards/miscelaneous.xml.in
+++ b/boards/miscelaneous.xml.in
@@ -5,6 +5,7 @@
 	 type="menu"
 	 section="/discovery"
 	 icon="miscelaneous.svg"
+	 difficulty="2"
 	 author="">
 	 <_title>Miscellaneous activities</_title>
 	 <_description>Time, Geography, ...</_description>
diff --git a/boards/mouse.xml.in b/boards/mouse.xml.in
index 4b85213..30da0af 100644
--- a/boards/mouse.xml.in
+++ b/boards/mouse.xml.in
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <GCompris>
-  <Board 
+  <Board
 	 name="mouse"
-	 type="menu" 
+	 type="menu"
 	 section="/computer"
 	 icon="mouse.svg"
+	 difficulty="1"
 	 author="">
 	 <_title>Mouse-manipulation activities.</_title>
 	 <_description>Various mouse-based activities (clicking, moving)</_description>
diff --git a/boards/numeration.xml.in b/boards/numeration.xml.in
index 11c41f9..fd4c32d 100644
--- a/boards/numeration.xml.in
+++ b/boards/numeration.xml.in
@@ -5,6 +5,7 @@
 	 type="menu"
 	 section="/math"
 	 icon="numeration.svg"
+	 difficulty="1"
 	 author="">
 	 <_title>Numeration</_title>
 	 <_description>Numeration activities.</_description>
diff --git a/boards/puzzle.xml.in b/boards/puzzle.xml.in
index 55f7415..be9a932 100644
--- a/boards/puzzle.xml.in
+++ b/boards/puzzle.xml.in
@@ -5,6 +5,7 @@
 	 type="menu"
 	 section="/"
 	 icon="puzzles.svg"
+	 difficulty="3"
 	 author="">
 	 <_title>Puzzles</_title>
 	 <_description>Various puzzles.</_description>
diff --git a/boards/reading.xml.in b/boards/reading.xml.in
index c098dc9..de6e68e 100644
--- a/boards/reading.xml.in
+++ b/boards/reading.xml.in
@@ -5,6 +5,7 @@
 	 type="menu"
 	 section="/"
 	 icon="book.svg"
+	 difficulty="6"
 	 author="">
 	 <_title>Go to the Reading activities</_title>
 	 <_description>Reading activities.</_description>
diff --git a/boards/strategy.xml.in b/boards/strategy.xml.in
index 078e97c..6fc1417 100644
--- a/boards/strategy.xml.in
+++ b/boards/strategy.xml.in
@@ -5,6 +5,7 @@
 	 type="menu"
 	 section="/"
 	 icon="strategy.svg"
+	 difficulty="8"
 	 author="">
 	 <_title>Strategy games</_title>
 	 <_description>Strategy games like chess, connect4, ...</_description>
diff --git a/src/boards/menu2.c b/src/boards/menu2.c
index 5fb57d4..8226399 100644
--- a/src/boards/menu2.c
+++ b/src/boards/menu2.c
@@ -485,17 +485,6 @@ static void menu_create_item(GooCanvasItem *parent, MenuItems *menuitems, Gcompr
 				      NULL);
   goo_canvas_item_scale(menu_button, ratio, ratio);
 
-  // display difficulty stars
-  if (board->difficulty != NULL)
-    {
-      difficulty = atoi(board->difficulty);
-      menu_difficulty_display(parent,
-			      (double)current_x - pixmap_w/2 - 25,
-			      (double)current_y - pixmap_h/2,
-			      (double) 0.6,
-			      difficulty);
-    }
-
   // display board availability due to sound voice not present
   if(board->mandatory_sound_file)
     {
@@ -537,6 +526,20 @@ static void menu_create_item(GooCanvasItem *parent, MenuItems *menuitems, Gcompr
 			current_x - pixmap_w/2 - 25,
 			current_y - pixmap_h/2);
     }
+  else
+    {
+      // display difficulty stars
+      if (board->difficulty != NULL)
+	{
+	  difficulty = atoi(board->difficulty);
+	  menu_difficulty_display(parent,
+				  (double)current_x - pixmap_w/2 - 25,
+				  (double)current_y - pixmap_h/2,
+				  (double) 0.6,
+				  difficulty);
+	}
+    }
+
 
   gdk_pixbuf_unref(menu_pixmap);
 



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