Re: Reverse display patch for GnomePager applet



Here's the patch file again as an attachment, the first time, Netscape
truncated some of the lines.

Cheers,
Grant

Grant Likely wrote:
> 
> Hello all,
> 
> I have written a patch for the gnome pager which enables the pager widgets
> to be displayed either before or after the task list.  Could people please
> try it out and comment back to me?  I'd like to see this integrated into the
> main source tree.
> 
> I wrote this patch because I like my gnomepager in a vertical orientation at
> the bottom left of my desktop in a corner panel, and I don't want the pager
> part moving up and down every time the task list changes.
> 
> Thanks,
> 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]