aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2004-12-25 20:46:26 +0000
committerJan Djärv2004-12-25 20:46:26 +0000
commit133c01167ee97820887336e20f4f516202e02ccf (patch)
tree7d86a10fcb05a29e855d5051c211aa068f6120c4 /src
parentd8f165a83ea0cc5ec18e22bb201d62a058ea71de (diff)
downloademacs-133c01167ee97820887336e20f4f516202e02ccf.tar.gz
emacs-133c01167ee97820887336e20f4f516202e02ccf.zip
* gtkutil.c (update_frame_tool_bar): Make the value of
tool-bar-button-margin control margins of images in tool bar.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/gtkutil.c29
2 files changed, 32 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3e9034c6261..5593e98906d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12004-12-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 12004-12-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 2
3 * gtkutil.c (update_frame_tool_bar): Make the value of
4 tool-bar-button-margin control margins of images in tool bar.
5
3 * alloc.c (check_depth): New variable. 6 * alloc.c (check_depth): New variable.
4 (overrun_check_malloc, overrun_check_realloc): Only add 7 (overrun_check_malloc, overrun_check_realloc): Only add
5 overhead and write check pattern if check_depth is 1 (to handle 8 overhead and write check pattern if check_depth is 1 (to handle
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 317f7824267..5d2b9becb9d 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3356,12 +3356,37 @@ update_frame_tool_bar (f)
3356 GList *icon_list; 3356 GList *icon_list;
3357 GList *iter; 3357 GList *iter;
3358 struct x_output *x = f->output_data.x; 3358 struct x_output *x = f->output_data.x;
3359 int hmargin, vmargin;
3359 3360
3360 if (! FRAME_GTK_WIDGET (f)) 3361 if (! FRAME_GTK_WIDGET (f))
3361 return; 3362 return;
3362 3363
3363 BLOCK_INPUT; 3364 BLOCK_INPUT;
3364 3365
3366 if (INTEGERP (Vtool_bar_button_margin)
3367 && XINT (Vtool_bar_button_margin) > 0)
3368 {
3369 hmargin = XFASTINT (Vtool_bar_button_margin);
3370 vmargin = XFASTINT (Vtool_bar_button_margin);
3371 }
3372 else if (CONSP (Vtool_bar_button_margin))
3373 {
3374 if (INTEGERP (XCAR (Vtool_bar_button_margin))
3375 && XINT (XCAR (Vtool_bar_button_margin)) > 0)
3376 hmargin = XFASTINT (XCAR (Vtool_bar_button_margin));
3377
3378 if (INTEGERP (XCDR (Vtool_bar_button_margin))
3379 && XINT (XCDR (Vtool_bar_button_margin)) > 0)
3380 vmargin = XFASTINT (XCDR (Vtool_bar_button_margin));
3381 }
3382
3383 /* The natural size (i.e. when GTK uses 0 as margin) looks best,
3384 so take DEFAULT_TOOL_BAR_BUTTON_MARGIN to mean "default for GTK",
3385 i.e. zero. This means that margins less than
3386 DEFAULT_TOOL_BAR_BUTTON_MARGIN has no effect. */
3387 hmargin = max (0, hmargin - DEFAULT_TOOL_BAR_BUTTON_MARGIN);
3388 vmargin = max (0, vmargin - DEFAULT_TOOL_BAR_BUTTON_MARGIN);
3389
3365 if (! x->toolbar_widget) 3390 if (! x->toolbar_widget)
3366 xg_create_tool_bar (f); 3391 xg_create_tool_bar (f);
3367 3392
@@ -3425,6 +3450,8 @@ update_frame_tool_bar (f)
3425 { 3450 {
3426 GtkWidget *w = xg_get_image_for_pixmap (f, img, x->widget, NULL); 3451 GtkWidget *w = xg_get_image_for_pixmap (f, img, x->widget, NULL);
3427 3452
3453 gtk_misc_set_padding (GTK_MISC (w), hmargin, vmargin);
3454
3428 gtk_toolbar_append_item (GTK_TOOLBAR (x->toolbar_widget), 3455 gtk_toolbar_append_item (GTK_TOOLBAR (x->toolbar_widget),
3429 0, 0, 0, 3456 0, 0, 0,
3430 w, 3457 w,
@@ -3480,6 +3507,8 @@ update_frame_tool_bar (f)
3480 XG_TOOL_BAR_IMAGE_DATA); 3507 XG_TOOL_BAR_IMAGE_DATA);
3481 g_list_free (chlist); 3508 g_list_free (chlist);
3482 3509
3510 gtk_misc_set_padding (GTK_MISC (wimage), hmargin, vmargin);
3511
3483 if (old_img != img->pixmap) 3512 if (old_img != img->pixmap)
3484 (void) xg_get_image_for_pixmap (f, img, x->widget, wimage); 3513 (void) xg_get_image_for_pixmap (f, img, x->widget, wimage);
3485 3514