+2003-03-13 John Levon <levon@movementarian.org>
+
+ * text.C (setHeightOfRow):
+ * rowpainter.h:
+ * rowpainter.C: make appendix mark have the text
+ "Appendix" so the user knows what it is
+
+ * LColor.h:
+ * LColor.C: s/appendixline/appendix/ from above
+
2003-03-13 John Levon <levon@movementarian.org>
* paragraph_pimpl.C: fix Andre's backing out of the strong assertion
{ insetframe, N_("inset frame"), "insetframe", "IndianRed", "insetframe" },
{ error, N_("LaTeX error"), "error", "Red", "error" },
{ eolmarker, N_("end-of-line marker"), "eolmarker", "Brown", "eolmarker" },
- { appendixline, N_("appendix line"), "appendixline", "Brown", "appendixline" },
+ { appendix, N_("appendix marker"), "appendix", "Brown", "appendix" },
{ changebar, N_("change bar"), "changebar", "Blue", "changebar" },
{ strikeout, N_("Deleted text"), "strikeout", "Red", "strikeout" },
{ newtext, N_("Added text"), "newtext", "Blue", "newtext" },
eolmarker,
/// Added space colour
added_space,
- /// Appendix line color
- appendixline,
+ /// Appendix marker color
+ appendix,
/// changebar color
changebar,
/// strike-out color
void RowPainter::paintAppendix()
{
+ if (!par_.params().appendix())
+ return;
+
// FIXME: can be just width_ ?
int const ww = bv_.workWidth();
- if (par_.params().appendix()) {
- pain_.line(1, yo_, 1, yo_ + row_.height(), LColor::appendixline);
- pain_.line(ww - 2, yo_, ww - 2, yo_ + row_.height(), LColor::appendixline);
- }
+ int y = yo_;
+
+ if (par_.params().startOfAppendix())
+ y += 2 * defaultRowHeight();
+
+ pain_.line(1, y, 1, yo_ + row_.height(), LColor::appendix);
+ pain_.line(ww - 2, y, ww - 2, yo_ + row_.height(), LColor::appendix);
}
}
+int RowPainter::paintAppendixStart(int y)
+{
+ LyXFont pb_font;
+ pb_font.setColor(LColor::appendix).decSize();
+
+ string const label = _("Appendix");
+ int w = 0;
+ int a = 0;
+ int d = 0;
+ font_metrics::rectText(label, pb_font, w, a, d);
+
+ int const text_start = xo_ + ((width_ - w) / 2);
+ int const text_end = text_start + w;
+
+ pain_.rectText(text_start, y + d, label, pb_font);
+
+ pain_.line(xo_ + 1, y, text_start, y, LColor::appendix);
+ pain_.line(text_end, y, xo_ + width_ - 2, y, LColor::appendix);
+
+ return 3 * defaultRowHeight();
+}
+
+
void RowPainter::paintFirst()
{
ParagraphParameters const & parparams = par_.params();
+ int y_top = 0;
+
// start of appendix?
if (parparams.startOfAppendix()) {
- pain_.line(1, yo_, width_ - 2, yo_, LColor::appendixline);
+ y_top += paintAppendixStart(yo_ + y_top + 2 * defaultRowHeight());
}
- int y_top = 0;
-
// the top margin
if (!row_.previous() && text_.isTopLevel())
y_top += PAPER_MARGIN;
void paintArabicComposeChar(lyx::pos_type & vpos);
void paintChars(lyx::pos_type & vpos, bool hebrew, bool arabic);
int paintPageBreak(string const & label, int y);
+ int paintAppendixStart(int y);
int paintLengthMarker(string const & prefix, VSpace const & vsp, int start);
/// returns true when CHANGED_IN_DRAW
bool paintText();
if (firstpar->params().pagebreakTop())
maxasc += 3 * defaultRowHeight();
+ if (firstpar->params().startOfAppendix())
+ maxasc += 3 * defaultRowHeight();
+
// This is special code for the chapter, since the label of this
// layout is printed in an extra row
if (layout->labeltype == LABEL_COUNTER_CHAPTER