especially in math where each equation has many insets.
* src/Insets.cpp: remove background_color_ member
(setBackgroundColor): remove
(backgroundColor): make virtual
* insets/InsetBranch.cpp:
* insets/InsetNote.cpp: move color setting code from setButtonLabel to
backgroundColor.
* insets/InsetBox.cpp (setButtonLabel): remove call to setBackgroundColor.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18750
a592a061-630c-0410-9148-
cb99ea01b6c8
/// pretty arbitrary dimensions
Inset::Inset()
- : dim_(10, 10, 10), background_color_(Color::background)
+ : dim_(10, 10, 10)
{}
}
-void Inset::setBackgroundColor(Color_color color)
-{
- background_color_ = color;
-}
-
-
Color_color Inset::backgroundColor() const
{
- return Color::color(background_color_);
+ return Color::background;
}
///
int scroll() const { return 0; }
///
- void setBackgroundColor(Color_color);
- ///
- Color_color backgroundColor() const;
+ virtual Color_color backgroundColor() const;
///
enum CollapseStatus {
Collapsed,
mutable Dimension dim_;
private:
virtual std::auto_ptr<Inset> doClone() const = 0;
- /** We store the Color::color value as an int to get Color.h out
- * of the header file.
- */
- int background_color_;
};
setLabel(label);
font.setColor(Color::foreground);
- setBackgroundColor(Color::background);
setLabelFont(font);
}
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<InsetBranch &>(*this)).showDialog(bv);
///
void setButtonLabel();
///
+ virtual Color_color backgroundColor() const;
+ ///
bool showInsetDialog(BufferView *) const;
///
int latex(Buffer const &, odocstream &,
font.decSize();
font.decSize();
+ Color_color c;
switch (params_.type) {
case InsetNoteParams::Note:
- font.setColor(Color::note);
- setBackgroundColor(Color::notebg);
+ c = Color::note;
break;
case InsetNoteParams::Comment:
- font.setColor(Color::comment);
- setBackgroundColor(Color::commentbg);
+ c = Color::comment;
break;
case InsetNoteParams::Greyedout:
- font.setColor(Color::greyedout);
- setBackgroundColor(Color::greyedoutbg);
+ c = Color::greyedout;
break;
case InsetNoteParams::Framed:
- font.setColor(Color::greyedout);
- setBackgroundColor(Color::greyedoutbg);
+ c = Color::greyedout;
break;
case InsetNoteParams::Shaded:
- font.setColor(Color::greyedout);
- setBackgroundColor(Color::shadedbg);
+ c = Color::greyedout;
break;
}
+ font.setColor(c);
setLabelFont(font);
}
+Color_color InsetNote::backgroundColor() const
+{
+ Color_color c;
+ switch (params_.type) {
+ case InsetNoteParams::Note:
+ c = Color::notebg;
+ break;
+ case InsetNoteParams::Comment:
+ c = Color::commentbg;
+ break;
+ case InsetNoteParams::Greyedout:
+ c = Color::greyedoutbg;
+ break;
+ case InsetNoteParams::Framed:
+ c = Color::greyedoutbg;
+ break;
+ case InsetNoteParams::Shaded:
+ c = Color::shadedbg;
+ break;
+ }
+ return c;
+}
+
+
bool InsetNote::showInsetDialog(BufferView * bv) const
{
InsetNoteMailer(const_cast<InsetNote &>(*this)).showDialog(bv);
void read(Buffer const & buf, Lexer & lex);
///
void setButtonLabel();
+ ///
+ virtual Color_color backgroundColor() const;
/// show the note dialog
bool showInsetDialog(BufferView * bv) const;
///