#include <config.h>
#include "BranchList.h"
+#include "LColor.h"
+#include "frontends/lyx_gui.h"
+#include <algorithm>
using std::string;
+Branch::Branch()
+{
+ lyx_gui::getRGBColor(LColor::background, color_);
+}
+
+
string const & Branch::getBranch() const
{
return branch_;
}
-string const & Branch::getColor() const
+lyx::RGBColor const & Branch::getColor() const
{
return color_;
}
-void Branch::setColor(string const & c)
+void Branch::setColor(lyx::RGBColor const & c)
{
color_ = c;
}
+void Branch::setColor(string const & c)
+{
+ if (c.size() == 7 && c[0] == '#')
+ color_ = lyx::RGBColor(c);
+ else
+ // no color set or invalid color - use normal background
+ lyx_gui::getRGBColor(LColor::background, color_);
+}
+
+
Branch * BranchList::find(std::string const & name)
{
List::iterator it =
Branch br;
br.setBranch(name);
br.setSelected(false);
- br.setColor("none");
list.push_back(br);
}
if (j == string::npos)