this is my last try to get this patch into the LyX repository!
The patch is used to display a smallskip/medskip/bigskip in textual form (more WYSIWYM, slightly less WYSIWYG). I consider it very difficult to distinguish a bigskip from a medskip on screen.
This patch is a direct adaption of a patch for LyX 1.2.2 which is in use for months! Please, please, commit this patch finally (which was written originally by John).
Thanks, Michael
Index: src/text.C =================================================================== RCS file: /cvs/lyx/lyx-devel/src/text.C,v retrieving revision 1.282 diff -u -r1.282 text.C --- src/text.C 2002/11/27 10:30:15 1.282 +++ src/text.C 2002/12/16 23:34:23 @@ -3235,13 +3235,12 @@ int LyXText::getLengthMarkerHeight(BufferView * bv, VSpace const & vsp) const { + if (vsp.kind() == VSpace::NONE) + return 0; + int const arrow_size = 4; int const space_size = int(vsp.inPixels(bv)); - if (vsp.kind() != VSpace::LENGTH) { - return space_size; - } - LyXFont font; font.decSize(); int const min_size = max(3 * arrow_size, @@ -3258,6 +3257,9 @@ int LyXText::drawLengthMarker(DrawRowParams & p, string const & prefix, VSpace const & vsp, int start) { + if (vsp.kind() == VSpace::NONE) + return 0; + int const arrow_size = 4; int const size = getLengthMarkerHeight(p.bv, vsp); int const end = start + size; @@ -3268,10 +3270,11 @@ int ty1, ty2; // y-values for bottom arrow int by1, by2; + + str = prefix + " (" + vsp.asLyXCommand() + ")"; + switch (vsp.kind()) { - case VSpace::LENGTH: - { - str = prefix + " (" + vsp.asLyXCommand() + ')'; + case VSpace::LENGTH: { // adding or removing space bool const added = !(vsp.length().len().value() < 0.0); ty1 = added ? (start + arrow_size) : start; @@ -3280,14 +3283,10 @@ by2 = added ? end : (end - arrow_size); break; } - case VSpace::VFILL: - str = prefix + _(" (vertical fill)"); + default: ty1 = ty2 = start; by1 = by2 = end; break; - default: - // nothing to draw here - return size; } int const leftx = p.xo + leftMargin(p.bv, p.row); @@ -3306,6 +3305,9 @@ p.pain->rectText(leftx + 2 * arrow_size + 5, start + ((end - start) / 2) + d, str, font); + + if (vsp.kind() != VSpace::LENGTH && vsp.kind() != VSpace::VFILL ) + return size; // top arrow p.pain->line(leftx, ty1, midx, ty2, LColor::added_space);