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

gEDA-cvs: CVS update: x_image.c



  User: werner  
  Date: 06/12/28 06:47:09

  Modified:    .        x_image.c
  Log:
  	* src/x_image.c: replaced the browse button with an icon.
  
  	  Misc cosmetics.
  
  
  
  
  Revision  Changes    Path
  1.29      +22 -19    eda/geda/gaf/gschem/src/x_image.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_image.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_image.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -b -r1.28 -r1.29
  --- x_image.c	17 Dec 2006 04:14:03 -0000	1.28
  +++ x_image.c	28 Dec 2006 11:47:09 -0000	1.29
  @@ -30,6 +30,7 @@
   
   #include "../include/globals.h"
   #include "../include/prototype.h"
  +#include "../include/x_dialog.h"
   
   #ifdef HAVE_LIBDMALLOC
   #include <dmalloc.h>
  @@ -388,7 +389,6 @@
     }
   }
   
  -
   /*! \todo Finish function documentation!!!
    *  \brief
    *  \par Function Description
  @@ -462,8 +462,9 @@
   		       GTK_SIGNAL_FUNC(x_image_response), w_current);
   
       box = GTK_DIALOG(w_current->iwindow)->vbox;
  -    gtk_container_set_border_width(GTK_CONTAINER(w_current->iwindow),5);
  -    gtk_box_set_spacing(GTK_BOX(box),5);
  +    gtk_container_set_border_width(GTK_CONTAINER(w_current->iwindow),
  +				   DIALOG_BORDER_SPACING);
  +    gtk_box_set_spacing(GTK_BOX(box), DIALOG_V_SPACING);
   
       label = gtk_label_new (_("Width x Height:"));
       gtk_misc_set_alignment( GTK_MISC (label), 0, 0);
  @@ -474,7 +475,7 @@
       gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu), 
   			      create_menu_size (w_current));
       gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu), 2);
  -    gtk_box_pack_start (GTK_BOX (box), optionmenu, TRUE, TRUE, 0);
  +    gtk_box_pack_start (GTK_BOX (box), optionmenu, FALSE, FALSE, 0);
   
       label = gtk_label_new (_("Filename:"));
       gtk_misc_set_alignment( GTK_MISC (label), 0, 0);
  @@ -482,14 +483,19 @@
       gtk_box_pack_start (GTK_BOX (box),
                           label, FALSE, FALSE, 0);
   
  -    hbox = gtk_hbox_new(FALSE,10);
  +    hbox = gtk_hbox_new(FALSE, 0);
       gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
       filename_entry = gtk_entry_new_with_max_length (200);
       gtk_editable_select_region (GTK_EDITABLE (filename_entry), 0, -1);
       gtk_box_pack_start (GTK_BOX (hbox),
                           filename_entry, TRUE, TRUE, 0);
   
  -    button = gtk_button_new_with_mnemonic(_("_Browse"));
  +    button = gtk_button_new();
  +    gtk_container_add(GTK_CONTAINER(button),
  +		      gtk_image_new_from_stock(GTK_STOCK_OPEN,
  +					       GTK_ICON_SIZE_SMALL_TOOLBAR));
  +    gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
  +
       gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
       g_signal_connect(button, "clicked",
   		     GTK_SIGNAL_FUNC (x_image_select_filename),
  @@ -497,22 +503,19 @@
   
       GLADE_HOOKUP_OBJECT(w_current->iwindow,filename_entry,"filename_entry");
   
  -    gtk_widget_show_all (box);
  +    gtk_widget_show_all (w_current->iwindow);
  +  }
  + 
  +  else { /* dialog already created */
  +    gtk_window_present(GTK_WINDOW(w_current->iwindow));
     }
    
  -  if (!GTK_WIDGET_VISIBLE (w_current->iwindow)) {
  -    filename_entry = g_object_get_data (G_OBJECT (w_current->iwindow), "filename_entry");
  +  /* always set the data entries in the dialog */
  +  filename_entry = g_object_get_data (G_OBJECT (w_current->iwindow), 
  +				      "filename_entry");
       gtk_entry_set_text(GTK_ENTRY(filename_entry), filename);
       w_current->image_width = 800;
       w_current->image_height = 600;
  -    gtk_widget_show (w_current->iwindow);
  -    gdk_window_raise(w_current->iwindow->window);
  -    /* gtk_grab_add (w_current->iwindow);*/
  -  } else {
  -    /* window should already be mapped */
  -    /* otherwise this will core */
  -    gdk_window_raise(w_current->iwindow->window);
  -  }
   }
   
   /*! \todo Finish function documentation!!!
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs