X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetBranch.cpp;h=62f6a57dbca5944e9bb44445382871a831c82462;hb=b81c90adeef28a836d9786671849401b747e350b;hp=152ce58f03f0029dd6e4dc63ece434a852930a07;hpb=897436efbb9bd641b61467d185a2dfae9839e575;p=lyx.git diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp index 152ce58f03..62f6a57dbc 100644 --- a/src/insets/InsetBranch.cpp +++ b/src/insets/InsetBranch.cpp @@ -22,7 +22,6 @@ #include "gettext.h" #include "Color.h" #include "Lexer.h" -#include "Paragraph.h" #include "OutputParams.h" #include @@ -98,22 +97,33 @@ void InsetBranch::setButtonLabel() font.decSize(); docstring s = _("Branch: ") + params_.branch; - font.setColor(Color::foreground); if (!params_.branch.empty()) { // FIXME UNICODE Color_color c = lcolor.getFromLyXName(to_utf8(params_.branch)); if (c == Color::none) { - c = Color::error; s = _("Undef: ") + s; } - setBackgroundColor(c); - } else - setBackgroundColor(Color::background); + } + font.setColor(Color::foreground); setLabel(isOpen() ? s : getNewLabel(s) ); setLabelFont(font); } +Color_color InsetBranch::backgroundColor() const +{ + if (!params_.branch.empty()) { + // FIXME UNICODE + Color_color c = lcolor.getFromLyXName(to_utf8(params_.branch)); + if (c == Color::none) { + c = Color::error; + } + return c; + } else + return Inset::backgroundColor(); +} + + bool InsetBranch::showInsetDialog(BufferView * bv) const { InsetBranchMailer(const_cast(*this)).showDialog(bv); @@ -152,7 +162,7 @@ void InsetBranch::doDispatch(Cursor & cur, FuncRequest & cmd) case LFUN_INSET_TOGGLE: - if (cmd.argument() == "assign" || cmd.argument().empty()) { + if (cmd.argument() == "assign") { // The branch inset uses "assign". if (isBranchSelected(cur.buffer())) { if (status() != Open)