Patch to gnome-pager



I have a patch for a simple change that I've made to the gnome-pager
applet.  It's a rather simple patch which allows the order of widgets in the
pager to be reversed.  I use this because I like the pager part to be below
the task list in a vertical panel.

This is my first patch, and I'd like somebody to review it, and integrate it
into CVS if it's acceptable.  Who do I need to send it to?   BTW, I've also
attached the patch to this message so anybody can look at it themselves.

Cheers,
Grant
--- gnome-pager/gnomepager_applet.c.orig	Mon May 17 21:24:56 1999
+++ gnome-pager/gnomepager_applet.c	Sat May 15 08:31:01 1999
@@ -24,6 +24,7 @@
 GdkPixmap          *m_1 = NULL, *m_2 = NULL, *m_3 = NULL;
 
 typedef struct {
+        gint                reverse_order; /*bool*/
 	gint                pager_rows;
 	gint                pager_size; /*bool*/
 	gint                tasks_all; /*bool*/
@@ -226,6 +227,13 @@
   gtk_object_set_data(GTK_OBJECT(check), "prop", prop);
   gtk_box_pack_start(GTK_BOX(vbox),check,FALSE,FALSE,0);
   
+  check = gtk_check_button_new_with_label(_("Place pagers after tasklist"));
+  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), config.reverse_order);
+  gtk_signal_connect(GTK_OBJECT(check), "toggled",
+		     GTK_SIGNAL_FUNC(cb_check), &o_config.reverse_order);
+  gtk_object_set_data(GTK_OBJECT(check), "prop", prop);
+  gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0);
+
   check = gtk_check_button_new_with_label(_("Use small pagers"));
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), config.pager_size);
   gtk_signal_connect(GTK_OBJECT(check), "toggled",
@@ -1352,6 +1360,7 @@
   gnome_config_set_int("stuff/show_pager", config.show_pager);
   gnome_config_set_int("stuff/show_icons", config.show_icons);
   gnome_config_set_int("stuff/show_arrow", config.show_arrow);
+  gnome_config_set_int("stuff/reverse_order", config.reverse_order);
   gnome_config_set_int("stuff/fixed_tasklist", config.fixed_tasklist);
   gnome_config_pop_prefix();
   gnome_config_sync();
@@ -1432,7 +1441,8 @@
   config.show_tasks = gnome_config_get_int("gnome_pager/stuff/show_tasks=1");
   config.show_pager = gnome_config_get_int("gnome_pager/stuff/show_pager=1");
   config.show_icons = gnome_config_get_int("gnome_pager/stuff/show_icons=1");
-  config.show_arrow = gnome_config_get_int("gnome_pager/stuff/show_arrow=1");
+  config.show_arrow = gnome_config_get_int("gnome_pager/stuff/show_arrow=1"); 
+
   /*make sure these are not done next time*/
   gnome_config_clean_file("gnome_pager");
 
@@ -1509,6 +1519,7 @@
   config.show_icons = gnome_config_get_int("stuff/show_icons=1");
   config.show_arrow = gnome_config_get_int("stuff/show_arrow=1");
   config.fixed_tasklist = gnome_config_get_int("stuff/fixed_tasklist=0");
+  config.reverse_order = gnome_config_get_int("stuff/reverse_order=0");
 
   gdk_error_warnings = 0;  
   get_desktop_names();
@@ -1992,7 +2003,11 @@
   align = gtk_alignment_new(0.5, 0.5, 0.0, 0.0);
   if (config.show_pager)
     gtk_widget_show(align);
-  gtk_box_pack_start(GTK_BOX(main_box), align, FALSE, FALSE, 0);
+
+  if (config.reverse_order)
+     gtk_box_pack_end(GTK_BOX(main_box), align, FALSE, FALSE, 0);
+  else
+     gtk_box_pack_start(GTK_BOX(main_box), align, FALSE, FALSE, 0);
   
   frame = gtk_frame_new(NULL);
   gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
@@ -2064,11 +2079,17 @@
      gtk_widget_show(arrow);
      gtk_container_add(GTK_CONTAINER(arrow_button), arrow);
 
-     gtk_box_pack_start(GTK_BOX(main_box), box, FALSE, FALSE, 0);
+     if (config.reverse_order)
+       gtk_box_pack_end(GTK_BOX(main_box), box, FALSE, FALSE, 0);
+     else
+       gtk_box_pack_start(GTK_BOX(main_box), box, FALSE, FALSE, 0);
     }
   
   frame = gtk_frame_new(NULL);
-  gtk_box_pack_start(GTK_BOX(main_box), frame, FALSE, FALSE, 0);
+  if (config.reverse_order)
+    gtk_box_pack_end(GTK_BOX(main_box), frame, FALSE, FALSE, 0);
+  else
+    gtk_box_pack_start(GTK_BOX(main_box), frame, FALSE, FALSE, 0);
   gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
   if (config.show_tasks)
     gtk_widget_show(frame);


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