]> git.lyx.org Git - features.git/commitdiff
Auto-generate centering info for centered labels.
authorRichard Heck <rgheck@comcast.net>
Wed, 15 Sep 2010 14:18:19 +0000 (14:18 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 15 Sep 2010 14:18:19 +0000 (14:18 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35393 a592a061-630c-0410-9148-cb99ea01b6c8

lib/layouts/stdstruct.inc
src/Layout.cpp

index 8c9eb2b60e3bde0790051eebb4d5592873bf6130..0eb7a1918f7d946f9d9d686bc78723ec2598127d 100644 (file)
@@ -35,10 +35,10 @@ Style Abstract
        EndFont
        HTMLLabel             div
        HTMLLabelFirst        1
+       HTMLForceCSS          1
        HTMLStyle
                div.abstract {
-                       margin-top: 2em;
-                       margin-bottom: 2em;
+                       margin: 4ex;
                }
                div.abstract_item {
                        font-size: small;
index daf298f509d33dd959d5d64e464222b96575f2f3..9a75637331dfb1c609785dd63650607ce9ff47aa 100644 (file)
@@ -1049,15 +1049,21 @@ void Layout::makeDefaultCSS() const {
                        from_ascii(htmltag() + "." + defaultCSSClass() + " {\n") +
                        htmldefaultstyle_ + from_ascii("\n}\n");
        
-       if (labelfont == font || htmllabeltag() == "NONE")
+       if (labeltype == LABEL_NO_LABEL || htmllabeltag() == "NONE")
                return;
        
+       docstring labelCSS;
+       
        // label font
-       docstring const labelfontCSS = labelfont.asCSS();
-       if (!labelfontCSS.empty())
+       if (labelfont != font)
+               labelCSS = labelfont.asCSS() + from_ascii("\n");
+       if (labeltype == LABEL_CENTERED_TOP_ENVIRONMENT)
+               labelCSS += from_ascii("text-align: center;\n");
+       
+       if (!labelCSS.empty())
                htmldefaultstyle_ +=
                        from_ascii(htmllabeltag() + "." + defaultCSSLabelClass() + " {\n") +
-                       labelfontCSS + from_ascii("\n}\n");
+                       labelCSS + from_ascii("\n}\n");
 }