From df1af5df47987c5ec84bd29e97dcbaa38aa93a27 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 27 Mar 2013 19:01:33 -0400 Subject: [PATCH] Update the XHTML output for InsetFloatList. We'll now use an InsetLayout to style it. --- lib/layouts/stdfloats.inc | 16 ++++++++++++++++ src/insets/InsetFloatList.cpp | 23 +++++++++++++---------- src/insets/InsetFloatList.h | 2 ++ 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/lib/layouts/stdfloats.inc b/lib/layouts/stdfloats.inc index ac5aaac46a..bb6a1de870 100644 --- a/lib/layouts/stdfloats.inc +++ b/lib/layouts/stdfloats.inc @@ -48,3 +48,19 @@ Float UsesFloatPkg true RefPrefix alg End + + +InsetLayout FloatList + HTMLStyle + a.lyxtoc-floats { + text-decoration: none; + color: black; + } + a.lyxtoc-floats:visited { color: black; } + div.lyxtoc-floats { + margin: 0em 0em 0.1em 1em; + font-size: large; + font-weight: normal; + } + EndHTMLStyle +End diff --git a/src/insets/InsetFloatList.cpp b/src/insets/InsetFloatList.cpp index 0f849b24ee..f477c649dc 100644 --- a/src/insets/InsetFloatList.cpp +++ b/src/insets/InsetFloatList.cpp @@ -234,7 +234,7 @@ docstring InsetFloatList::xhtml(XHTMLStream &, OutputParams const & op) const { } string const tocclass = lay ? " " + lay->defaultCSSClass(): ""; - string const tocattr = "class='tochead + toc-" + toctype + " " + tocclass + "'"; + string const tocattr = "class='tochead toc-" + toctype + tocclass + "'"; // we'll use our own stream, because we are going to defer everything. // that's how we deal with the fact that we're probably inside a standard @@ -242,7 +242,7 @@ docstring InsetFloatList::xhtml(XHTMLStream &, OutputParams const & op) const { odocstringstream ods; XHTMLStream xs(ods); - xs << html::StartTag("div", "class='toc'"); + xs << html::StartTag("div", "class='toc toc-floats'"); xs << html::StartTag("div", tocattr) << toclabel << html::EndTag("div"); @@ -251,15 +251,11 @@ docstring InsetFloatList::xhtml(XHTMLStream &, OutputParams const & op) const { Toc::const_iterator const en = toc.end(); for (; it != en; ++it) { Paragraph const & par = it->dit().innerParagraph(); - string const attr = "class='lyxtoc-" + toctype + "'"; - Font const dummy; + string const attr = "class='lyxtoc-floats lyxtoc-" + toctype + "'"; xs << html::StartTag("div", attr); - string const parattr = "href='#" + par.magicLabel() + "' class='tocarrow'"; - xs << it->str() << " " - << html::StartTag("a", parattr) - // FIXME XHTML - // There ought to be a simple way to customize this. - << XHTMLStream::ESCAPE_NONE << ">" + string const parattr = "href='#" + par.magicLabel() + "' class='lyxtoc-floats'"; + xs << html::StartTag("a", parattr) + << it->str() << html::EndTag("a"); xs << html::EndTag("div"); } @@ -271,6 +267,13 @@ docstring InsetFloatList::xhtml(XHTMLStream &, OutputParams const & op) const { void InsetFloatList::validate(LaTeXFeatures & features) const { features.useFloat(to_ascii(getParam("type"))); + features.useInsetLayout(getLayout()); +} + + +docstring InsetFloatList::layoutName() const +{ + return "FloatList:" + getParam("type"); } diff --git a/src/insets/InsetFloatList.h b/src/insets/InsetFloatList.h index 46b294a0ab..58a7e232f6 100644 --- a/src/insets/InsetFloatList.h +++ b/src/insets/InsetFloatList.h @@ -69,6 +69,8 @@ private: //@{ /// Inset * clone() const { return new InsetFloatList(*this); } + /// + docstring layoutName() const; //@} /// \name Private functions inherited from InsetCommand class -- 2.39.2