]> git.lyx.org Git - features.git/commitdiff
small cleanup collapsable; label fix branch
authorMartin Vermeer <martin.vermeer@hut.fi>
Sat, 1 Sep 2007 17:55:21 +0000 (17:55 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Sat, 1 Sep 2007 17:55:21 +0000 (17:55 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19976 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetBranch.cpp
src/insets/InsetCollapsable.cpp

index c0a20430034459a410de44e316009734c1ac168e..3510d4bdaa4dbfef2b0326532e176ba370bb554e 100644 (file)
@@ -87,16 +87,13 @@ void InsetBranch::read(Buffer const & buf, Lexer & lex)
 {
        params_.read(lex);
        InsetCollapsable::read(buf, lex);
+       setLayout(buf.params());
        setButtonLabel();
 }
 
 
 void InsetBranch::setButtonLabel()
 {
-       Font font(Font::ALL_SANE);
-       font.decSize();
-       font.decSize();
-
        docstring s = _("Branch: ") + params_.branch;
        if (!params_.branch.empty()) {
                // FIXME UNICODE
@@ -105,9 +102,7 @@ void InsetBranch::setButtonLabel()
                        s = _("Undef: ") + s;
                }
        }
-       font.setColor(Color::foreground);
        setLabel(isOpen() ? s : getNewLabel(s) );
-       setLabelFont(font);
 }
 
 
@@ -139,6 +134,7 @@ void InsetBranch::doDispatch(Cursor & cur, FuncRequest & cmd)
                InsetBranchParams params;
                InsetBranchMailer::string2params(to_utf8(cmd.argument()), params);
                params_.branch = params.branch;
+               setLayout(cur.buffer().params());
                setButtonLabel();
                break;
        }
index 9600c0e9d37e5ebade81d2314e21d2f7c842900d..58a7fd53825f23500a2a0de9068e93f1710d0aae 100644 (file)
@@ -296,7 +296,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
                const_cast<InsetCollapsable *>(this)->setDrawFrame(true);
 
                int desc = InsetText::descent();
-               if (status() == Open)
+               if (geometry() == SubLabel)
                        desc -= ascent();
                else
                        desc -= 3;
@@ -319,8 +319,8 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
                pi.pain.line(x + dim_.wid - 3, y + desc, x + dim_.wid - 3, y + desc - 4,
                        layout_.labelfont.color());
 
-               // the label of the charstyle. Can be toggled.
-               if (status() == Open) {
+               // the label below the text. Can be toggled.
+               if (geometry() == SubLabel) {
                        Font font(layout_.labelfont);
                        font.realize(Font(Font::ALL_SANE));
                        font.decSize();