# HG changeset patch # User youngs # Date 1035467104 0 # Node ID 332649c64dbc3c4e00c753853a5ba85f7c47f9b0 # Parent bfff82cca6e6eb6843011aceb3465f6414776cf9 [xemacs-hg @ 2002-10-24 13:44:51 by youngs] 2002-10-24 Andy Piper * glyphs-widget.c (layout_query_geometry): only resize dynamically if static sizes haven't been set. diff -r bfff82cca6e6 -r 332649c64dbc src/ChangeLog --- a/src/ChangeLog Wed Oct 23 21:53:40 2002 +0000 +++ b/src/ChangeLog Thu Oct 24 13:45:04 2002 +0000 @@ -1,3 +1,8 @@ +2002-10-24 Andy Piper + + * glyphs-widget.c (layout_query_geometry): only resize dynamically + if static sizes haven't been set. + 2002-09-21 Stephen J. Turnbull * extents.c (Fset_extent_property): Document `syntax-table' diff -r bfff82cca6e6 -r 332649c64dbc src/glyphs-widget.c --- a/src/glyphs-widget.c Wed Oct 23 21:53:40 2002 +0000 +++ b/src/glyphs-widget.c Thu Oct 24 13:45:04 2002 +0000 @@ -1301,8 +1301,7 @@ characters and logical units so that frames can be sized appropriately. */ -/* Query the geometry of a layout widget. We assume that we can only - get here if the size is not already fixed. */ +/* Query the geometry of a layout widget. */ static void layout_query_geometry (Lisp_Object image_instance, int* width, int* height, enum image_instance_geometry disp, @@ -1359,46 +1358,50 @@ /* Work out minimum space we need to fit all the items. This could have been fixed by the user. */ - if (!NILP (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii))) - { - Lisp_Object dynamic_width = - eval_within_redisplay (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii)); - if (INTP (dynamic_width)) - *width = XINT (dynamic_width); - } - else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_HORIZONTAL) - { - *width = maxpw + ((nitems + 1) * widget_instance_border_width (ii) + - IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2; - } - else - { - *width = maxpw + 2 * (widget_instance_border_width (ii) * 2 + - IMAGE_INSTANCE_MARGIN_WIDTH (ii)); - } - + if (IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii)) { + if (!NILP (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii))) + { + Lisp_Object dynamic_width = + Feval (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii)); + if (INTP (dynamic_width)) + *width = XINT (dynamic_width); + } + else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_HORIZONTAL) + { + *width = maxpw + ((nitems + 1) * widget_instance_border_width (ii) + + IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2; + } + else + { + *width = maxpw + 2 * (widget_instance_border_width (ii) * 2 + + IMAGE_INSTANCE_MARGIN_WIDTH (ii)); + } + } + /* Work out vertical spacings. */ - if (!NILP (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii))) - { - Lisp_Object dynamic_height = - eval_within_redisplay (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)); - if (INTP (dynamic_height)) - *height = XINT (dynamic_height); - } - else if (IMAGE_INSTANCE_SUBWINDOW_LOGICAL_LAYOUT (ii)) - { - *height = nitems * luh + ph_adjust; - } - else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_VERTICAL) - { - *height = maxph + ((nitems + 1) * widget_instance_border_width (ii) + - IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust; - } - else - { - *height = maxph + (2 * widget_instance_border_width (ii) + - IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust; - } + if (IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii)) { + if (!NILP (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii))) + { + Lisp_Object dynamic_height = + Feval (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)); + if (INTP (dynamic_height)) + *height = XINT (dynamic_height); + } + else if (IMAGE_INSTANCE_SUBWINDOW_LOGICAL_LAYOUT (ii)) + { + *height = nitems * luh + ph_adjust; + } + else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) == LAYOUT_VERTICAL) + { + *height = maxph + ((nitems + 1) * widget_instance_border_width (ii) + + IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust; + } + else + { + *height = maxph + (2 * widget_instance_border_width (ii) + + IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2 + ph_adjust; + } + } #ifdef DEBUG_WIDGET_OUTPUT stderr_out ("layout wants %dx%d\n", *width, *height); #endif