if (pi.full_repaint)
// Clear background (if not delegated to rows)
pain.fillRectangle(0, metrics_info_.y1, width_,
if (pi.full_repaint)
// Clear background (if not delegated to rows)
pain.fillRectangle(0, metrics_info_.y1, width_,
- metrics_info_.y2 - metrics_info_.y1, text.backgroundColor());
+ metrics_info_.y2 - metrics_info_.y1,
+ buffer_.inset().backgroundColor());
TextMetrics const & tm = text_metrics_[&text];
TextMetrics const & tm = text_metrics_[&text];
PainterInfo::PainterInfo(BufferView * bv, lyx::frontend::Painter & painter)
PainterInfo::PainterInfo(BufferView * bv, lyx::frontend::Painter & painter)
- : pain(painter), ltr_pos(false), erased_(false), full_repaint(true)
+ : pain(painter), ltr_pos(false), erased_(false), full_repaint(true),
+ background_color(Color::background)
bool erased_;
///
bool full_repaint;
bool erased_;
///
bool full_repaint;
+ ///
+ int background_color;
};
class TextMetricsInfo {};
};
class TextMetricsInfo {};
-Color_color Text::backgroundColor() const
-{
- return Color_color(Color::color(background_color_));
-}
-
-
void Text::breakParagraph(Cursor & cur, bool keep_layout)
{
BOOST_ASSERT(this == cur.text());
void Text::breakParagraph(Cursor & cur, bool keep_layout)
{
BOOST_ASSERT(this == cur.text());
/// FIXME: replace Cursor with DocIterator.
void insertStringAsParagraphs(Cursor & cur, docstring const & str);
/// FIXME: replace Cursor with DocIterator.
void insertStringAsParagraphs(Cursor & cur, docstring const & str);
- /// return the color of the canvas
- Color_color backgroundColor() const;
-
/// access to our paragraphs
ParagraphList const & paragraphs() const { return pars_; }
ParagraphList & paragraphs() { return pars_; }
/// access to our paragraphs
ParagraphList const & paragraphs() const { return pars_; }
ParagraphList & paragraphs() { return pars_; }
void deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool trackChanges);
public:
void deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool trackChanges);
public:
- ///
- int background_color_;
-
namespace lyx {
Text::Text()
namespace lyx {
Text::Text()
- : background_color_(Color::background),
- autoBreakRows_(false)
+ : autoBreakRows_(false)
// (if paragraph background was not cleared)
if (!pi.full_repaint && row_has_changed) {
pi.pain.fillRectangle(x, y - rit->ascent(),
// (if paragraph background was not cleared)
if (!pi.full_repaint && row_has_changed) {
pi.pain.fillRectangle(x, y - rit->ascent(),
- width(), rit->height(),
- text_->backgroundColor());
+ width(), rit->height(),
+ Color_color(Color::color(pi.background_color)));
}
// Instrumentation for testing row cache (see also
}
// Instrumentation for testing row cache (see also
void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
{
autoOpen_ = pi.base.bv->cursor().isInside(this);
void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
{
autoOpen_ = pi.base.bv->cursor().isInside(this);
- text_.background_color_ = backgroundColor();
+ pi.background_color = backgroundColor();
const int xx = x + TEXT_TO_INSET_OFFSET;
// Draw button first -- top, left or only
const int xx = x + TEXT_TO_INSET_OFFSET;
// Draw button first -- top, left or only