comparison src/glyphs-widget.c @ 1068:9d75b4fe084c

[xemacs-hg @ 2002-10-24 14:19:25 by youngs] 2002-10-24 Andy Piper <andy@xemacs.org> * glyphs-widget.c (layout_query_geometry): add in fiddle factor. Include border text in width layout calculation. (layout_layout): use BORDER_FIDDLE_FACTOR instead of 10.
author youngs
date Thu, 24 Oct 2002 14:19:36 +0000
parents 332649c64dbc
children b531bf8658e9
comparison
equal deleted inserted replaced
1067:a0a7ace216fe 1068:9d75b4fe084c
66 static int widget_border_width (Lisp_Object domain); 66 static int widget_border_width (Lisp_Object domain);
67 static int widget_spacing (Lisp_Object domain); 67 static int widget_spacing (Lisp_Object domain);
68 static void widget_query_string_geometry (Lisp_Object string, Lisp_Object face, 68 static void widget_query_string_geometry (Lisp_Object string, Lisp_Object face,
69 int *width, int *height, Lisp_Object domain); 69 int *width, int *height, Lisp_Object domain);
70 70
71 #define BORDER_FIDDLE_FACTOR 10
71 #ifdef DEBUG_WIDGETS 72 #ifdef DEBUG_WIDGETS
72 int debug_widget_instances; 73 int debug_widget_instances;
73 #endif 74 #endif
74 75
75 /* TODO: 76 /* TODO:
1332 if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii))) 1333 if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii)))
1333 { 1334 {
1334 glyph_query_geometry (XCAR (items), &gwidth, &gheight, disp, 1335 glyph_query_geometry (XCAR (items), &gwidth, &gheight, disp,
1335 image_instance); 1336 image_instance);
1336 ph_adjust = gheight; 1337 ph_adjust = gheight;
1338 /* Include text width in vertical layouts. */
1339 if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_VERTICAL)
1340 maxpw = gwidth + BORDER_FIDDLE_FACTOR;
1337 items = XCDR (items); 1341 items = XCDR (items);
1338 } 1342 }
1339 1343
1340 /* Flip through the items to work out how much stuff we have to display */ 1344 /* Flip through the items to work out how much stuff we have to display */
1341 LIST_LOOP (rest, items) 1345 LIST_LOOP (rest, items)
1446 ph_adjust = gheight; 1450 ph_adjust = gheight;
1447 /* The offset for the border is half the glyph height. */ 1451 /* The offset for the border is half the glyph height. */
1448 IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (gheight / 2); 1452 IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (gheight / 2);
1449 1453
1450 /* #### Really, what should this be? */ 1454 /* #### Really, what should this be? */
1451 glyph_do_layout (border, gwidth, gheight, 10, 0, 1455 glyph_do_layout (border, gwidth, gheight, BORDER_FIDDLE_FACTOR, 0,
1452 image_instance); 1456 image_instance);
1453 } 1457 }
1454 1458
1455 /* Flip through the items to work out how much stuff we have to display. */ 1459 /* Flip through the items to work out how much stuff we have to display. */
1456 LIST_LOOP (rest, items) 1460 LIST_LOOP (rest, items)