gcompris r3496 - in branches/gcomprixogoo: boards/skins/babytoy boards/skins/gartoon src/boards src/submarine-activity
- From: bcoudoin svn gnome org
- To: svn-commits-list gnome org
- Subject: gcompris r3496 - in branches/gcomprixogoo: boards/skins/babytoy boards/skins/gartoon src/boards src/submarine-activity
- Date: Fri, 15 Aug 2008 22:27:22 +0000 (UTC)
Author: bcoudoin
Date: Fri Aug 15 22:27:21 2008
New Revision: 3496
URL: http://svn.gnome.org/viewvc/gcompris?rev=3496&view=rev
Log:
improved menu. now the description is no more hard drawed in the
background but is displayed dynamically. It allows a better integration
with the new control bar.
Removed:
branches/gcomprixogoo/boards/skins/babytoy/gcompris-init.jpg
branches/gcomprixogoo/boards/skins/gartoon/gcompris-init.jpg
Modified:
branches/gcomprixogoo/boards/skins/babytoy/gcompris-menu2bg.png
branches/gcomprixogoo/boards/skins/gartoon/gcompris-menu2bg.png
branches/gcomprixogoo/src/boards/menu2.c
branches/gcomprixogoo/src/submarine-activity/submarine.c
Modified: branches/gcomprixogoo/boards/skins/babytoy/gcompris-menu2bg.png
==============================================================================
Binary files. No diff available.
Modified: branches/gcomprixogoo/boards/skins/gartoon/gcompris-menu2bg.png
==============================================================================
Binary files. No diff available.
Modified: branches/gcomprixogoo/src/boards/menu2.c
==============================================================================
--- branches/gcomprixogoo/src/boards/menu2.c (original)
+++ branches/gcomprixogoo/src/boards/menu2.c Fri Aug 15 22:27:21 2008
@@ -30,7 +30,7 @@
#define MENU_PER_LINE 5
typedef struct {
- /* Information items (_s are shadow) */
+ GooCanvasItem *bg; /* Background */
GooCanvasItem *boardname_item;
GooCanvasItem *description_item;
GooCanvasItem *author_item;
@@ -111,7 +111,7 @@
#define D_INT_Y 5
#define I_X 140
-#define I_Y 410
+#define I_Y 390
#define I_W 600
#define I_H 125
@@ -215,6 +215,12 @@
gcomprisBoard=agcomprisBoard;
+ /* set initial values for this level */
+ gcomprisBoard->level = 1;
+ gcomprisBoard->maxlevel=1;
+ gc_bar_set(GC_BAR_CONFIG|GC_BAR_ABOUT);
+ gc_bar_set_level(gcomprisBoard);
+
menuitems = g_new(MenuItems, 1);
img = gc_skin_image_get("gcompris-menu2bg.png");
@@ -238,14 +244,6 @@
else
display_welcome(menuitems);
- /* set initial values for this level */
- gcomprisBoard->level = 1;
- gcomprisBoard->maxlevel=1;
- gc_bar_set(GC_BAR_CONFIG|GC_BAR_ABOUT);
-
- /* FIXME : Workaround for bugged canvas */
- //goo_canvas_update_now(gcomprisBoard->canvas);
-
menu_pause(FALSE);
}
@@ -555,6 +553,10 @@
board = g_object_get_data (G_OBJECT (item), "board");
+ if(G_IS_OBJECT(menuitems->bg))
+ g_object_set(menuitems->bg,
+ "visibility", GOO_CANVAS_ITEM_VISIBLE, NULL);
+
if(board->title && G_IS_OBJECT(menuitems->boardname_item))
g_object_set (menuitems->boardname_item,
"text", board->title,
@@ -580,6 +582,9 @@
GdkEventCrossing *event,
MenuItems *menuitems)
{
+ g_object_set(menuitems->bg,
+ "visibility", GOO_CANVAS_ITEM_INVISIBLE, NULL);
+
g_object_set (menuitems->boardname_item,
"text", "", NULL);
@@ -642,11 +647,27 @@
g_assert(parent);
- menuitems->boardname_item = \
+ menuitems->bg =
+ goo_canvas_rect_new (parent,
+ info_x,
+ info_y,
+ info_w,
+ info_h,
+ "stroke_color_rgba", 0xFFFFFFFFL,
+ "fill_color_rgba", 0x0000FF90L,
+ "line-width", (double) 2,
+ "radius-x", (double) 10,
+ "radius-y", (double) 10,
+ NULL);
+
+ g_object_set(menuitems->bg,
+ "visibility", GOO_CANVAS_ITEM_INVISIBLE, NULL);
+
+ menuitems->boardname_item = \
goo_canvas_text_new (parent,
"",
x,
- y,
+ y + 20,
-1,
GTK_ANCHOR_CENTER,
"font", gc_skin_font_board_big,
@@ -658,8 +679,8 @@
goo_canvas_text_new (parent,
"",
x,
- y + 34,
- info_w,
+ y + 54,
+ info_w - 10,
GTK_ANCHOR_CENTER,
"font", gc_skin_font_board_medium,
"fill-color-rgba", gc_skin_get_color("menu/text"),
@@ -670,14 +691,13 @@
goo_canvas_text_new (parent,
"",
x,
- y + 90,
+ y + 110,
-1,
GTK_ANCHOR_CENTER,
"font", gc_skin_font_board_tiny,
"fill-color-rgba", gc_skin_get_color("menu/text"),
"alignment", PANGO_ALIGN_CENTER,
NULL);
-
}
static gdouble
@@ -799,10 +819,39 @@
}
+static gboolean
+display_welcome_event (GooCanvasItem *item,
+ GooCanvasItem *target,
+ GdkEventCrossing *event,
+ MenuItems *menuitems)
+{
+ if(G_IS_OBJECT(menuitems->bg))
+ g_object_set(menuitems->bg,
+ "visibility", GOO_CANVAS_ITEM_VISIBLE, NULL);
+
+ if(G_IS_OBJECT(menuitems->boardname_item))
+ g_object_set(menuitems->boardname_item,
+ "text", "GCompris V" VERSION,
+ NULL);
+
+ if(G_IS_OBJECT(menuitems->description_item))
+ g_object_set(menuitems->description_item,
+ "text",
+ _("GCompris is a collection of educational games that provides different activities for children aged 2 and up."),
+ NULL);
+
+ if(G_IS_OBJECT(menuitems->author_item))
+ g_object_set(menuitems->author_item,
+ "text", "", NULL);
+
+ return FALSE;
+}
+
static void
display_welcome (MenuItems *menuitems)
{
GdkPixbuf *pixmap;
+ GooCanvasItem *item;
if (actualSectionItem)
g_error("actualSectionItem exists in display_section !");
@@ -813,30 +862,20 @@
pixmap = gc_skin_pixmap_load("gcompris-about.png");
- goo_canvas_image_new (actualSectionItem,
- pixmap,
- display_x + display_w/2.0 -
- gdk_pixbuf_get_width(pixmap)/2,
- display_y + display_h/2.0 -
- gdk_pixbuf_get_height(pixmap)/2,
- NULL);
+ item = goo_canvas_image_new (actualSectionItem,
+ pixmap,
+ display_x + display_w/2.0 -
+ gdk_pixbuf_get_width(pixmap)/2,
+ display_y + display_h/2.0 -
+ gdk_pixbuf_get_height(pixmap)/2,
+ NULL);
gdk_pixbuf_unref(pixmap);
- if(G_IS_OBJECT(menuitems->boardname_item))
- g_object_set(menuitems->boardname_item,
- "text", "GCompris V" VERSION,
- NULL);
-
- if(G_IS_OBJECT(menuitems->description_item))
- g_object_set(menuitems->description_item,
- "text",
- _("GCompris is a collection of educational games that provides different activities for children aged 2 and up."),
- NULL);
-
- if(G_IS_OBJECT(menuitems->author_item))
- g_object_set(menuitems->author_item,
- "text", "", NULL);
+ g_signal_connect (item, "enter_notify_event",
+ (GtkSignalFunc) display_welcome_event, menuitems);
+ g_signal_connect (item, "leave_notify_event",
+ (GtkSignalFunc) on_leave_notify, menuitems);
menu_displayed = TRUE;
}
Modified: branches/gcomprixogoo/src/submarine-activity/submarine.c
==============================================================================
--- branches/gcomprixogoo/src/submarine-activity/submarine.c (original)
+++ branches/gcomprixogoo/src/submarine-activity/submarine.c Fri Aug 15 22:27:21 2008
@@ -127,7 +127,7 @@
/* ================================================================ */
static GooCanvasItem *boardRootItem = NULL;
-static GooCanvasItem *sub_schema_image_item, *submarine_item,
+static GooCanvasItem *submarine_item,
*ballast_av_purge_item, *ballast_ar_purge_item, *regleur_purge_item;
static GooCanvasItem *ballast_av_chasse_item, *ballast_ar_chasse_item, *regleur_chasse_item;
gboolean ballast_av_purge_open, ballast_ar_purge_open, regleur_purge_open;
@@ -314,8 +314,6 @@
* =====================================================================*/
static void submarine_next_level()
{
- gc_bar_set_level(gcomprisBoard);
-
ballast_av_purge_open = ballast_ar_purge_open = regleur_purge_open = FALSE;
ballast_av_chasse_open = ballast_ar_chasse_open = regleur_chasse_open = FALSE;
air_charging = battery_charging = FALSE;
@@ -338,6 +336,8 @@
/* Try the next level */
submarine_create_item(goo_canvas_get_root_item(gcomprisBoard->canvas));
+ gc_bar_set_level(gcomprisBoard);
+
}
/* =====================================================================
* Destroy all the items
@@ -384,6 +384,7 @@
gdk_pixbuf_unref(pixmap);
+
pixmap = gc_pixmap_load("submarine/sub_schema.png");
w = gdk_pixbuf_get_width(pixmap);
@@ -391,11 +392,11 @@
schema_x = (BOARDWIDTH - w)/2 ;
schema_y = BOARDHEIGHT - h;
- sub_schema_image_item = goo_canvas_image_new (boardRootItem,
- pixmap,
- schema_x,
- schema_y,
- NULL);
+ goo_canvas_image_new (boardRootItem,
+ pixmap,
+ schema_x,
+ schema_y,
+ NULL);
gdk_pixbuf_unref(pixmap);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]