#include "Buffer.h"
#include "BufferParams.h"
#include "BranchList.h"
+#include "Color.h"
#include "Counters.h"
#include "Cursor.h"
#include "DispatchResult.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
#include "gettext.h"
-#include "Color.h"
#include "Lexer.h"
#include "OutputParams.h"
using std::ostringstream;
-void InsetBranch::init()
-{
- setButtonLabel();
-}
-
-
InsetBranch::InsetBranch(BufferParams const & bp,
InsetBranchParams const & params)
: InsetCollapsable(bp), params_(params)
{
- setLayout(bp);
- init();
+ setButtonLabel();
}
InsetBranch::InsetBranch(InsetBranch const & in)
: InsetCollapsable(in), params_(in.params_)
{
- init();
+ setButtonLabel();
}
{
params_.read(lex);
InsetCollapsable::read(buf, lex);
- setLayout(buf.params());
- setButtonLabel();
}
docstring s = _("Branch: ") + params_.branch;
if (!params_.branch.empty()) {
// FIXME UNICODE
- Color_color c = lcolor.getFromLyXName(to_utf8(params_.branch));
- if (c == Color::none) {
+ ColorCode c = lcolor.getFromLyXName(to_utf8(params_.branch));
+ if (c == Color_none) {
s = _("Undef: ") + s;
}
}
- setLabel(isOpen() ? s : getNewLabel(s) );
+ if (decoration() == Classic)
+ setLabel(isOpen() ? s : getNewLabel(s) );
+ else
+ setLabel(params_.branch + ": " + getNewLabel(s));
}
-Color_color InsetBranch::backgroundColor() const
+ColorCode 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;
+ ColorCode c = lcolor.getFromLyXName(to_utf8(params_.branch));
+ if (c == Color_none) {
+ c = Color_error;
}
return c;
} else
InsetBranchMailer::string2params(to_utf8(cmd.argument()), params);
params_.branch = params.branch;
setLayout(cur.buffer().params());
- setButtonLabel();
break;
}
bool InsetBranch::isBranchSelected(Buffer const & buffer) const
{
- Buffer const & realbuffer = *buffer.getMasterBuffer();
+ Buffer const & realbuffer = *buffer.masterBuffer();
BranchList const & branchlist = realbuffer.params().branchlist();
BranchList::const_iterator const end = branchlist.end();
BranchList::const_iterator it =