[Patch] Small tasklist addition



Greetings everybody,

I really liked the sunken-in look of the gnome tasklist that Gnome 1.0
had, and was very disappointed to see it go in 1.2  So, I invoked the
power of the GPL and did something about it.  Attached is a patch to
gnome-core/applets/tasklist from gnome-core version 1.2.2.1 that adds that
functionality back in as an option for people who want to use it.  Feel
free to make use of it, add it to the real Gnome tree, poke at it, throw
it out, or whatever.  Either way, I will continue to use it this new way.
:)

By the way, if my patch is broken, let me know and I will happily make a
new one.  I always feel paranoid about the correct way to make patches...

Cory Lueninghoener
------------------
cluenin1 bigred unl edu        http://harold.unl.edu/~cluening
cluening cse unl edu           http://www.thepests.com
Common subdirectories: /home/cluening/gnome/gnome-core/gnome-core-1.2.2.1/applets/tasklist/help and tasklist/help
diff -u /home/cluening/gnome/gnome-core/gnome-core-1.2.2.1/applets/tasklist/tasklist_applet.c tasklist/tasklist_applet.c
--- /home/cluening/gnome/gnome-core/gnome-core-1.2.2.1/applets/tasklist/tasklist_applet.c	Sun Sep 24 14:49:56 2000
+++ tasklist/tasklist_applet.c	Sun Oct  1 22:51:31 2000
@@ -319,22 +319,22 @@
 		}
 		
 		if (Config.horz_fixed) {
-			curheight = (ROW_HEIGHT * get_horz_rows() - 0) / num_rows;
-			curwidth = (Config.horz_width - 0) / num_cols;
+			curheight = (ROW_HEIGHT * get_horz_rows() - (Config.sunken?4:0)) / num_rows;
+			curwidth = (Config.horz_width - (Config.sunken?4:0)) / num_cols;
 
 		} else {
-			curheight = (ROW_HEIGHT * get_horz_rows() - 0) / num_rows;
+			curheight = (ROW_HEIGHT * get_horz_rows() - (Config.sunken?4:0)) / num_rows;
 			curwidth = Config.horz_taskwidth;
 
 			/* If the total width is higher than allowed, 
 			   we use the "fixed" way instead */
 			if ((curwidth * num_cols) > Config.horz_width)
-				curwidth = (Config.horz_width - 0) / num_cols;
+				curwidth = (Config.horz_width - (Config.sunken?4:0)) / num_cols;
 		}
 
 
-		curx = 0;
-		cury = 0;
+		curx = (Config.sunken?2:0);
+		cury = (Config.sunken?2:0);
 
 
 		while (temp_tasks) {
@@ -351,7 +351,7 @@
 				if (curx >= Config.horz_width ||
 				    curx + curwidth > Config.horz_width) {
 					cury += curheight;
-					curx = 0;
+					curx = (Config.sunken?2:0);
 				}
 			} else {
 
@@ -359,7 +359,7 @@
 
 				if (curx >= num_cols * curwidth) {
 					cury += curheight;
-					curx = 0;
+					curx = (Config.sunken?2:0);
 				}
 			}
 			
@@ -396,15 +396,15 @@
 
 		curheight = ROW_HEIGHT;
 		if (Config.follow_panel_size)
-			curwidth = panel_size - 0;
+			curwidth = panel_size - (Config.sunken?4:0);
 		else
-			curwidth = Config.vert_width - 0;
+			curwidth = Config.vert_width - (Config.sunken?4:0);
 		
 		num_cols = 1;
 		num_rows = num;
 		
-		curx = 0;
-		cury = 0;
+		curx = (Config.sunken?2:0);
+		cury = (Config.sunken?2:0);
 
 		if (Config.vert_fixed)
 			vert_height = Config.vert_height;
@@ -425,9 +425,9 @@
 
 			if (curx >= (Config.follow_panel_size?
 				     panel_size:
-				     Config.vert_width) - 0) {
+				     Config.vert_width)-(Config.sunken?4:0)) {
 				cury += curheight;
-				curx = 0;
+				curx = (Config.sunken?2:0);
 			}
 			
 			if (temp_tasks->next)
@@ -595,11 +595,12 @@
 
 	temp_tasks = get_visible_tasks ();
 
-	gtk_paint_flat_box (area->style, area->window,
-			    area->state, GTK_SHADOW_NONE,
-			    &event->area, area, "button",
-			    0, 0, -1, -1);
-	
+	gtk_paint_box (area->style, area->window,
+		       area->state, 
+		       Config.sunken?GTK_SHADOW_IN:GTK_SHADOW_NONE,
+		       &event->area, area, "button",
+		       0, 0, -1, -1);
+
 	while (temp_tasks) {
 		GdkRectangle rect, dest;
 		task = (TasklistTask *)temp_tasks->data;
diff -u /home/cluening/gnome/gnome-core/gnome-core-1.2.2.1/applets/tasklist/tasklist_applet.h tasklist/tasklist_applet.h
--- /home/cluening/gnome/gnome-core/gnome-core-1.2.2.1/applets/tasklist/tasklist_applet.h	Tue May  9 13:21:12 2000
+++ tasklist/tasklist_applet.h	Sun Oct  1 11:51:43 2000
@@ -46,6 +46,7 @@
 	gboolean all_desks_minimized; /* Show minimized tasks on all desktops */
 	gboolean confirm_before_kill; /* Confirm before killing windows */
 	gboolean move_to_current; /* Move iconified tasks to current workspace */
+	gboolean sunken; /* Sunken or popped-up look */
 	
 	/* Follow the panel sizes */
 	gboolean follow_panel_size;
diff -u /home/cluening/gnome/gnome-core/gnome-core-1.2.2.1/applets/tasklist/tasklist_config.c tasklist/tasklist_config.c
--- /home/cluening/gnome/gnome-core/gnome-core-1.2.2.1/applets/tasklist/tasklist_config.c	Mon Apr  3 15:26:41 2000
+++ tasklist/tasklist_config.c	Sun Oct  1 22:19:37 2000
@@ -50,6 +50,8 @@
 			       Config.confirm_before_kill);
 	gnome_config_set_bool ("tasklist/move_to_current",
 			       Config.move_to_current);
+	gnome_config_set_bool ("tasklist/sunken", Config.sunken);
+	
 	gnome_config_sync ();
 	
 	gnome_config_pop_prefix ();
@@ -82,6 +84,7 @@
 	Config.all_desks_normal = gnome_config_get_bool ("tasklist/all_desks_normal=false");
 	Config.all_desks_minimized = gnome_config_get_bool ("tasklist/all_desks_minimized=false");
 	Config.move_to_current = gnome_config_get_bool ("tasklist/move_to_current=false");
+	Config.sunken = gnome_config_get_bool ("tasklist/sunken=false");
 	
 	gnome_config_pop_prefix ();
 }
diff -u /home/cluening/gnome/gnome-core/gnome-core-1.2.2.1/applets/tasklist/tasklist_properties.c tasklist/tasklist_properties.c
--- /home/cluening/gnome/gnome-core/gnome-core-1.2.2.1/applets/tasklist/tasklist_properties.c	Sun Apr 16 09:58:35 2000
+++ tasklist/tasklist_properties.c	Sat Sep 30 14:08:04 2000
@@ -285,6 +285,9 @@
 	gtk_box_pack_start (GTK_BOX (miscbox),
 			    create_check_button (_("Move iconified tasks to current workspace when restoring"), &PropsConfig.move_to_current),
 			    FALSE, TRUE, 0);
+	gtk_box_pack_start (GTK_BOX (miscbox),
+			    create_check_button (_("Sink tasklist into panel"), &PropsConfig.sunken),
+			    FALSE, TRUE, 0);
 
 	gnome_property_box_append_page (GNOME_PROPERTY_BOX (prop), vbox,
 					gtk_label_new (_("Display")));


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