emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/gtkutil.c


From: Jan Djärv
Subject: [Emacs-diffs] Changes to emacs/src/gtkutil.c
Date: Sat, 25 Dec 2004 15:58:41 -0500

Index: emacs/src/gtkutil.c
diff -c emacs/src/gtkutil.c:1.55 emacs/src/gtkutil.c:1.56
*** emacs/src/gtkutil.c:1.55    Tue Dec  7 08:25:43 2004
--- emacs/src/gtkutil.c Sat Dec 25 20:46:26 2004
***************
*** 3356,3367 ****
--- 3356,3392 ----
    GList *icon_list;
    GList *iter;
    struct x_output *x = f->output_data.x;
+   int hmargin, vmargin;
  
    if (! FRAME_GTK_WIDGET (f))
      return;
  
    BLOCK_INPUT;
  
+   if (INTEGERP (Vtool_bar_button_margin)
+       && XINT (Vtool_bar_button_margin) > 0)
+     {
+       hmargin = XFASTINT (Vtool_bar_button_margin);
+       vmargin = XFASTINT (Vtool_bar_button_margin);
+     }
+   else if (CONSP (Vtool_bar_button_margin))
+     {
+       if (INTEGERP (XCAR (Vtool_bar_button_margin))
+           && XINT (XCAR (Vtool_bar_button_margin)) > 0)
+         hmargin = XFASTINT (XCAR (Vtool_bar_button_margin));
+ 
+       if (INTEGERP (XCDR (Vtool_bar_button_margin))
+           && XINT (XCDR (Vtool_bar_button_margin)) > 0)
+         vmargin = XFASTINT (XCDR (Vtool_bar_button_margin));
+     }
+ 
+   /* The natural size (i.e. when GTK uses 0 as margin) looks best,
+      so take DEFAULT_TOOL_BAR_BUTTON_MARGIN to mean "default for GTK",
+      i.e. zero.  This means that margins less than
+      DEFAULT_TOOL_BAR_BUTTON_MARGIN has no effect.  */
+   hmargin = max (0, hmargin - DEFAULT_TOOL_BAR_BUTTON_MARGIN);
+   vmargin = max (0, vmargin - DEFAULT_TOOL_BAR_BUTTON_MARGIN);
+   
    if (! x->toolbar_widget)
      xg_create_tool_bar (f);
  
***************
*** 3425,3430 ****
--- 3450,3457 ----
          {
            GtkWidget *w = xg_get_image_for_pixmap (f, img, x->widget, NULL);
  
+           gtk_misc_set_padding (GTK_MISC (w), hmargin, vmargin);
+ 
            gtk_toolbar_append_item (GTK_TOOLBAR (x->toolbar_widget),
                                     0, 0, 0,
                                     w,
***************
*** 3480,3485 ****
--- 3507,3514 ----
                                                        XG_TOOL_BAR_IMAGE_DATA);
            g_list_free (chlist);
  
+           gtk_misc_set_padding (GTK_MISC (wimage), hmargin, vmargin);
+ 
            if (old_img != img->pixmap)
              (void) xg_get_image_for_pixmap (f, img, x->widget, wimage);
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]