]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbranch.C
The speed patch: redraw only rows that have changed
[lyx.git] / src / insets / insetbranch.C
index 9a9fe58ed742128eb37195c9e5e56a7612db3bb9..a18bf41d4f8693cc3b5aeefbd99dc70c628cc570 100644 (file)
@@ -95,12 +95,17 @@ void InsetBranch::setButtonLabel()
        font.decSize();
 
        string s = _("Branch: ") + params_.branch;
-       setLabel(isOpen() ? s : getNewLabel(s) );
        font.setColor(LColor::foreground);
-       if (!params_.branch.empty())
-               setBackgroundColor(lcolor.getFromLyXName(params_.branch));
-       else
+       if (!params_.branch.empty()) {
+               LColor_color c = lcolor.getFromLyXName(params_.branch);
+               if (c == LColor::none) {
+                       c = LColor::error;
+                       s = _("Undef: ") + s;
+               }
+               setBackgroundColor(c);
+       } else
                setBackgroundColor(LColor::background);
+       setLabel(isOpen() ? s : getNewLabel(s) );
        setLabelFont(font);
 }