revert wrongly committed patch

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18263 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2007-05-11 02:34:56 +00:00
parent a8e9fe82d0
commit e44fc571cc
8 changed files with 9 additions and 33 deletions

View File

@ -298,7 +298,6 @@ Color::Color()
{ graphicsbg, N_("graphics background"), "graphicsbg", "linen", "graphicsbg" },
{ mathmacrobg, N_("Math macro background"), "mathmacrobg", "linen", "mathmacrobg" },
{ mathframe, N_("math frame"), "mathframe", "Magenta", "mathframe" },
{ mathcorners, N_("math corners"), "mathcorners", "linen", "mathcorners" },
{ mathline, N_("math line"), "mathline", "Blue", "mathline" },
{ captionframe, N_("caption frame"), "captionframe", "DarkRed", "captionframe" },
{ collapsable, N_("collapsable inset text"), "collapsable", "DarkRed", "collapsable" },

View File

@ -123,10 +123,8 @@ public:
mathbg,
/// Macro math inset background color
mathmacrobg,
/// Math inset frame color under focus
/// Math inset frame color
mathframe,
/// Math inset frame color not under focus
mathcorners,
/// Math line color
mathline,

View File

@ -117,12 +117,12 @@ static TranslatorMap const build_translator()
/// pretty arbitrary dimensions
Inset::Inset()
: dim_(10, 10, 10), background_color_(Color::background), redraw_background_(true)
: dim_(10, 10, 10), background_color_(Color::background)
{}
Inset::Inset(Inset const & inset)
: dim_(inset.dim_), background_color_(inset.background_color_), redraw_background_(true)
: dim_(inset.dim_), background_color_(inset.background_color_)
{}
@ -288,7 +288,7 @@ void Inset::metricsMarkers2(Dimension & dim, int framesize) const
void Inset::drawMarkers(PainterInfo & pi, int x, int y) const
{
Color::color pen_color = editing(pi.base.bv)?
Color::mathframe : Color::mathcorners;
Color::mathframe : Color::background;
int const t = x + width() - 1;
int const d = y + descent();
@ -303,7 +303,7 @@ void Inset::drawMarkers(PainterInfo & pi, int x, int y) const
void Inset::drawMarkers2(PainterInfo & pi, int x, int y) const
{
Color::color pen_color = editing(pi.base.bv)?
Color::mathframe : Color::mathcorners;
Color::mathframe : Color::background;
drawMarkers(pi, x, y);
int const t = x + width() - 1;

View File

@ -192,9 +192,6 @@ public:
/// is called when the mouse enter or leave this inset
/// return true if this inset needs repaint
virtual bool setMouseHover(bool) { return false; }
/// tells an inset to redraw background
virtual void setRedrawBackground(bool rd) const { redraw_background_ = rd; }
bool redrawBackground() const { return redraw_background_; }
/// request "external features"
virtual void validate(LaTeXFeatures &) const {}
@ -492,8 +489,6 @@ private:
* of the header file.
*/
int background_color_;
mutable bool redraw_background_;
};

View File

@ -214,7 +214,7 @@ public:
void mathmlize(MathStream &) const;
///
//void octave(OctaveStream &) const;
/// tells an inset to redraw background
protected:
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
///

View File

@ -48,7 +48,6 @@
#include "insets/RenderPreview.h"
#include "insets/InsetLabel.h"
#include "frontends/Painter.h"
#include "graphics/PreviewImage.h"
#include "graphics/PreviewLoader.h"
@ -170,7 +169,7 @@ InsetMathHull::InsetMathHull()
InsetMathHull::InsetMathHull(HullType type)
: InsetMathGrid(getCols(type), 1), type_(type), nonum_(1), label_(1),
: InsetMathGrid(getCols(type), 1), type_(type), nonum_(1), label_(1),
preview_(new RenderPreview(this))
{
initMath();
@ -180,7 +179,7 @@ InsetMathHull::InsetMathHull(HullType type)
InsetMathHull::InsetMathHull(InsetMathHull const & other)
: InsetMathGrid(other),
type_(other.type_), nonum_(other.nonum_), label_(other.label_),
type_(other.type_), nonum_(other.nonum_), label_(other.label_),
preview_(new RenderPreview(this))
{}
@ -334,15 +333,7 @@ bool InsetMathHull::metrics(MetricsInfo & mi, Dimension & dim) const
void InsetMathHull::draw(PainterInfo & pi, int x, int y) const
{
// setRedrawBackground(false);
use_preview_ = previewState(pi.base.bv);
/*Cursor & cur = pi.base.bv->cursor();
if (!editing(pi.base.bv) || !cur.selection() || &cur.inset() != this)
*/
lyxerr << "redraw " << x << " " << y << " " << width() << " " << redrawBackground() << std::endl;
if (redrawBackground())
pi.pain.fillRectangle(x + 1, y - ascent() + 1, width() - 2,
ascent() + descent() - 1, Color::mathbg);
if (use_preview_) {
// one pixel gap in front

View File

@ -15,7 +15,6 @@
#include "InsetMathGrid.h"
#include <boost/scoped_ptr.hpp>
#include "debug.h"
namespace lyx {
@ -121,6 +120,7 @@ public:
///
static int displayMargin() { return 12; }
protected:
InsetMathHull(InsetMathHull const &);
@ -183,8 +183,6 @@ private:
boost::scoped_ptr<RenderPreview> preview_;
///
mutable bool use_preview_;
///
/// mutable bool redraw_background_;
//
// Incorporate me
//

View File

@ -310,8 +310,6 @@ void MathData::draw(PainterInfo & pi, int x, int y) const
|| x >= bv. workWidth())
return;
for (size_t i = 0, n = size(); i != n; ++i) {
MathAtom const & at = operator[](i);
#if 0
@ -333,10 +331,7 @@ void MathData::draw(PainterInfo & pi, int x, int y) const
#endif
bv.coordCache().insets().add(at.nucleus(), x, y);
at->drawSelection(pi, x, y);
at->setRedrawBackground(false);
lyxerr << "selection draw " << x << " " << y << " " << at->redrawBackground() << std::endl;
at->draw(pi, x, y);
//at->setRedrawBackground(true);
x += at->width();
}
}