Update the XHTML output for InsetFloatList. We'll now use an

InsetLayout to style it.
This commit is contained in:
Richard Heck 2013-03-27 19:01:33 -04:00
parent 1f6f5d2d53
commit df1af5df47
3 changed files with 31 additions and 10 deletions

View File

@ -48,3 +48,19 @@ Float
UsesFloatPkg true UsesFloatPkg true
RefPrefix alg RefPrefix alg
End 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

View File

@ -234,7 +234,7 @@ docstring InsetFloatList::xhtml(XHTMLStream &, OutputParams const & op) const {
} }
string const tocclass = lay ? " " + lay->defaultCSSClass(): ""; 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. // 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 // 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; odocstringstream ods;
XHTMLStream xs(ods); XHTMLStream xs(ods);
xs << html::StartTag("div", "class='toc'"); xs << html::StartTag("div", "class='toc toc-floats'");
xs << html::StartTag("div", tocattr) xs << html::StartTag("div", tocattr)
<< toclabel << toclabel
<< html::EndTag("div"); << html::EndTag("div");
@ -251,15 +251,11 @@ docstring InsetFloatList::xhtml(XHTMLStream &, OutputParams const & op) const {
Toc::const_iterator const en = toc.end(); Toc::const_iterator const en = toc.end();
for (; it != en; ++it) { for (; it != en; ++it) {
Paragraph const & par = it->dit().innerParagraph(); Paragraph const & par = it->dit().innerParagraph();
string const attr = "class='lyxtoc-" + toctype + "'"; string const attr = "class='lyxtoc-floats lyxtoc-" + toctype + "'";
Font const dummy;
xs << html::StartTag("div", attr); xs << html::StartTag("div", attr);
string const parattr = "href='#" + par.magicLabel() + "' class='tocarrow'"; string const parattr = "href='#" + par.magicLabel() + "' class='lyxtoc-floats'";
xs << it->str() << " " xs << html::StartTag("a", parattr)
<< html::StartTag("a", parattr) << it->str()
// FIXME XHTML
// There ought to be a simple way to customize this.
<< XHTMLStream::ESCAPE_NONE << "&gt;"
<< html::EndTag("a"); << html::EndTag("a");
xs << html::EndTag("div"); xs << html::EndTag("div");
} }
@ -271,6 +267,13 @@ docstring InsetFloatList::xhtml(XHTMLStream &, OutputParams const & op) const {
void InsetFloatList::validate(LaTeXFeatures & features) const void InsetFloatList::validate(LaTeXFeatures & features) const
{ {
features.useFloat(to_ascii(getParam("type"))); features.useFloat(to_ascii(getParam("type")));
features.useInsetLayout(getLayout());
}
docstring InsetFloatList::layoutName() const
{
return "FloatList:" + getParam("type");
} }

View File

@ -69,6 +69,8 @@ private:
//@{ //@{
/// ///
Inset * clone() const { return new InsetFloatList(*this); } Inset * clone() const { return new InsetFloatList(*this); }
///
docstring layoutName() const;
//@} //@}
/// \name Private functions inherited from InsetCommand class /// \name Private functions inherited from InsetCommand class