? depcomp
? stamp-h1
Index: gnome-about/ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-desktop/gnome-about/ChangeLog,v
retrieving revision 1.186
diff -p -u -r1.186 ChangeLog
--- gnome-about/ChangeLog	25 Jan 2005 15:03:13 -0000	1.186
+++ gnome-about/ChangeLog	6 Feb 2005 15:56:17 -0000
@@ -1,3 +1,11 @@
+2005-02-06  William Jon McCann  <mccann@jhu.edu>
+
+	* gnome-about.c (animate_contributor, animate_text) 
+	(display_introduction_message, create_canvas):
+	Improve ability to scale dialog with font size.
+
+	* contributors.h: Add myself.
+
 ==================== 2.9.90.1 ====================
 
 ==================== 2.9.90 ====================
Index: gnome-about/contributors.h
===================================================================
RCS file: /cvs/gnome/gnome-desktop/gnome-about/contributors.h,v
retrieving revision 1.91
diff -p -u -r1.91 contributors.h
--- gnome-about/contributors.h	11 Oct 2004 00:59:13 -0000	1.91
+++ gnome-about/contributors.h	6 Feb 2005 15:56:17 -0000
@@ -197,6 +197,7 @@ static gchar *contributors[] = {
 	"Dietmar Maurer",
 	"Justin Maurer",
 	"Shaun McCance",
+	"William Jon McCann",
 	"Gregory McLean",
 	"Mark McLoughlin",
 	"Michael Meeks",
Index: gnome-about/gnome-about.c
===================================================================
RCS file: /cvs/gnome/gnome-desktop/gnome-about/gnome-about.c,v
retrieving revision 1.65
diff -p -u -r1.65 gnome-about.c
--- gnome-about/gnome-about.c	25 Dec 2004 14:54:52 -0000	1.65
+++ gnome-about/gnome-about.c	6 Feb 2005 15:56:18 -0000
@@ -1,3 +1,4 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /* gnome-about.c: Super Funky Dope gnome about window.
  *
  * Copyright (C) 2002, Sun Microsystems, Inc.
@@ -54,7 +55,9 @@ static gdouble canvas_height = 350.0;
 
 static char             **introduction_messages = NULL;
 static GnomeCanvasItem   *subheader = NULL;
+static gdouble            header_height = 0.0;
 static gdouble            version_info_height = 0.0;
+static gdouble            intro_height = 0.0;
 static gint               contrib_i = 0;
 static gint              *contrib_order;
 
@@ -73,8 +76,12 @@ animate_contributor (gpointer data)
 	AnimationData *ani_data = (AnimationData *)data;
 	gboolean before_middle;
 	gdouble tmp, tmp2, y;
-	guint color, tmpcolor;
+	guint color;
+	guint color_delta;
+	gint tmpcolor;
 	gdouble size;
+	gdouble n_steps;
+	gdouble y_delta = -2.5;
 
 	g_object_get (ani_data->item,
 		      "text_width", &tmp,
@@ -93,14 +100,20 @@ animate_contributor (gpointer data)
 		      "y2", tmp2 / 2.0 + 3.0,
 		      NULL);
 
-	before_middle = 130.0 + ((canvas_height - 130.0 - version_info_height - tmp2) / 2.0) < y;
+	before_middle = (header_height + (intro_height - tmp2) / 2.0) < y;
 
+	n_steps = intro_height / ABS (y_delta);
+	color_delta = 0xff * 2 / n_steps;
 	/* update the color */
 	tmpcolor = color & 0xff;
-	tmpcolor += before_middle ? -6 : 6;
+	/* make sure we don't wrap around */
+	tmpcolor += before_middle ? (-1 * color_delta) : color_delta;
+	tmpcolor = MAX (0, tmpcolor);
+	tmpcolor = MIN (0xff, tmpcolor);
 	size += before_middle ? 1.0 : -1.0;
-	size = MAX (0.0, size);
-	color = GNOME_CANVAS_COLOR_A (tmpcolor, tmpcolor, tmpcolor, tmpcolor);
+	size = MAX (0.1, size);
+
+	color = GNOME_CANVAS_COLOR_A ((guint)tmpcolor, (guint)tmpcolor, (guint)tmpcolor, (guint)tmpcolor);
 
 	g_object_set (ani_data->item,
 		      "fill_color_rgba", color,
@@ -108,14 +121,14 @@ animate_contributor (gpointer data)
 		      NULL);
 
 	/* move damnit!! */
-	gnome_canvas_item_move (ani_data->item->parent, 0.0, -2.5);
+	gnome_canvas_item_move (ani_data->item->parent, 0.0, y_delta);
 
-	y -= 2.5;
+	y -= y_delta;
 
 	gnome_canvas_update_now (ani_data->canvas);
 
 	/* time for a new one ??? */
-	if (y <= 130.0) {
+	if (y <= header_height) {
 		display_contributors (ani_data->canvas);
 		g_free (ani_data);
 		return FALSE;
@@ -282,7 +295,7 @@ animate_text (gpointer data)
 
 	gnome_canvas_item_move (ani_data->item->parent, 0.0, -10.0);
 
-	if (ani_data->item->parent->y1 <= 120.0) {
+	if (ani_data->item->parent->y1 <= header_height) {
 		g_timeout_add (5 * 1000,
 			       display_introduction_message,
 			       ani_data->canvas);
@@ -319,6 +332,8 @@ display_introduction_message (gpointer d
 
 	if (!intro_text) {
 		gdouble tmp;
+		gdouble tmp2;
+		gdouble intro_width = canvas_width * 0.9;
 
 		intro =
 			gnome_canvas_item_new (GNOME_CANVAS_GROUP (canvas->root),
@@ -329,28 +344,29 @@ display_introduction_message (gpointer d
 			gnome_canvas_item_new (GNOME_CANVAS_GROUP (intro),
 					       gnome_canvas_rect_get_type (),
 					       "fill_color", "White",
-					       "x1", -4.0,
-					       "y1", -4.0,
-					       "x2", 304.0,
-					       "y2", 84.0,
+					       "x1", 0,
+					       "y1", 0,
+					       "x2", intro_width,
+					       "y2", intro_height,
 					       NULL);
 
 		intro_text =
 			gnome_canvas_item_new (GNOME_CANVAS_GROUP (intro),
 					       gnome_canvas_rich_text_get_type (),
 					       "text", introduction_messages[intro_i],
-						"editable", FALSE,
-					       /* FIXME */
-					       "width", 300.0,
-					       "height", 80.0,
+					       "editable", FALSE,
+					       "width", intro_width,
+					       "height", intro_height,
 					       "grow_height", TRUE,
 					       "cursor_visible", FALSE,
 					       NULL);
 
-		g_object_get (intro_text, "height", &tmp, NULL);
+		g_object_get (intro_text, "width", &tmp, NULL);
+		g_object_get (intro_text, "height", &tmp2, NULL);
 		gnome_canvas_item_move (intro,
-					(canvas_width - 300.0) / 2.0,
-					 canvas_height - version_info_height - tmp);
+					(canvas_width - tmp) / 2.0,
+                                        header_height + tmp2);
+
 		gnome_canvas_update_now (canvas);
 	} else {
 		gdouble y;
@@ -366,6 +382,7 @@ display_introduction_message (gpointer d
 		gnome_canvas_item_move (intro,
 					0.0,
 					canvas_height - version_info_height - y - tmp);
+
 		gnome_canvas_update_now (canvas);
 	}
 
@@ -955,10 +972,11 @@ create_canvas (void)
 	gdouble current_y;
 	gdouble dot_delta;
 	gdouble tmp;
+	gdouble tmp2;
+	gdouble last_line_offset;
 
 	/* set up a canvas */
 	canvas = gnome_canvas_new ();
-
 	gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas), 0, 0,
 					canvas_width, canvas_height);
 	gtk_widget_set_size_request (canvas, canvas_width, canvas_height);
@@ -1002,6 +1020,7 @@ create_canvas (void)
 	/* make a nice guess for the dot delta */
 	g_object_get (href->item, "text_height", &tmp, NULL);
 	dot_delta = tmp / 4.5;
+	last_line_offset = tmp;
 
 	/* draw a dot */
 	item = create_dot (root, &current_x, &current_y, dot_delta);
@@ -1043,6 +1062,7 @@ create_canvas (void)
 
 	/* resize */
 	canvas_width = current_x;
+	canvas_height = 15 * last_line_offset;
 	gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas), 0, 0,
 					canvas_width, canvas_height);
 	gtk_widget_set_size_request (GTK_WIDGET (canvas),
@@ -1079,12 +1099,14 @@ create_canvas (void)
 				      gnome_canvas_text_get_type (),
 				      "markup", text,
 				      "anchor", GTK_ANCHOR_NW,
-				      "y", current_y + 25.0,
+				      "y", current_y + last_line_offset,
 				      "fill_color", "#000000",
 				      NULL);
 	g_free (text);
 
 	g_object_get (item, "text_width", &tmp, NULL);
+	g_object_get (item, "text_height", &tmp2, NULL);
+	last_line_offset += tmp2;
 	gnome_canvas_item_set (item,
 			       "x", (canvas_width - tmp) / 2.0,
 			       NULL);
@@ -1096,19 +1118,28 @@ create_canvas (void)
 				      gnome_canvas_text_get_type (),
 				      "markup", text,
 				      "anchor", GTK_ANCHOR_NW,
-				      "y", current_y + 55.0,
+				      "y", current_y + last_line_offset,
 				      NULL);
 	subheader = item;
 	gnome_canvas_item_hide (item);
 	g_free (text);
 
 	g_object_get (item, "text_width", &tmp, NULL);
+	g_object_get (item, "text_height", &tmp2, NULL);
+	last_line_offset += tmp2;
+
 	gnome_canvas_item_set (item,
 			       "x", (canvas_width - tmp) / 2.0,
 			       NULL);
 
+	g_object_get (item, "text_height", &tmp2, NULL);
+	last_line_offset += tmp2;
+	header_height = current_y + last_line_offset;
+
 	/* and the version info */
 	display_version_info (root);
+
+	intro_height = canvas_height - version_info_height - header_height;
 
 	/* pfff done */
 	return canvas;
