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" }, { graphicsbg, N_("graphics background"), "graphicsbg", "linen", "graphicsbg" },
{ mathmacrobg, N_("Math macro background"), "mathmacrobg", "linen", "mathmacrobg" }, { mathmacrobg, N_("Math macro background"), "mathmacrobg", "linen", "mathmacrobg" },
{ mathframe, N_("math frame"), "mathframe", "Magenta", "mathframe" }, { mathframe, N_("math frame"), "mathframe", "Magenta", "mathframe" },
{ mathcorners, N_("math corners"), "mathcorners", "linen", "mathcorners" },
{ mathline, N_("math line"), "mathline", "Blue", "mathline" }, { mathline, N_("math line"), "mathline", "Blue", "mathline" },
{ captionframe, N_("caption frame"), "captionframe", "DarkRed", "captionframe" }, { captionframe, N_("caption frame"), "captionframe", "DarkRed", "captionframe" },
{ collapsable, N_("collapsable inset text"), "collapsable", "DarkRed", "collapsable" }, { collapsable, N_("collapsable inset text"), "collapsable", "DarkRed", "collapsable" },

View File

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

View File

@ -117,12 +117,12 @@ static TranslatorMap const build_translator()
/// pretty arbitrary dimensions /// pretty arbitrary dimensions
Inset::Inset() 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) 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 void Inset::drawMarkers(PainterInfo & pi, int x, int y) const
{ {
Color::color pen_color = editing(pi.base.bv)? Color::color pen_color = editing(pi.base.bv)?
Color::mathframe : Color::mathcorners; Color::mathframe : Color::background;
int const t = x + width() - 1; int const t = x + width() - 1;
int const d = y + descent(); 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 void Inset::drawMarkers2(PainterInfo & pi, int x, int y) const
{ {
Color::color pen_color = editing(pi.base.bv)? Color::color pen_color = editing(pi.base.bv)?
Color::mathframe : Color::mathcorners; Color::mathframe : Color::background;
drawMarkers(pi, x, y); drawMarkers(pi, x, y);
int const t = x + width() - 1; int const t = x + width() - 1;

View File

@ -192,9 +192,6 @@ public:
/// is called when the mouse enter or leave this inset /// is called when the mouse enter or leave this inset
/// return true if this inset needs repaint /// return true if this inset needs repaint
virtual bool setMouseHover(bool) { return false; } 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" /// request "external features"
virtual void validate(LaTeXFeatures &) const {} virtual void validate(LaTeXFeatures &) const {}
@ -492,8 +489,6 @@ private:
* of the header file. * of the header file.
*/ */
int background_color_; int background_color_;
mutable bool redraw_background_;
}; };

View File

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

View File

@ -48,7 +48,6 @@
#include "insets/RenderPreview.h" #include "insets/RenderPreview.h"
#include "insets/InsetLabel.h" #include "insets/InsetLabel.h"
#include "frontends/Painter.h"
#include "graphics/PreviewImage.h" #include "graphics/PreviewImage.h"
#include "graphics/PreviewLoader.h" #include "graphics/PreviewLoader.h"
@ -334,15 +333,7 @@ bool InsetMathHull::metrics(MetricsInfo & mi, Dimension & dim) const
void InsetMathHull::draw(PainterInfo & pi, int x, int y) const void InsetMathHull::draw(PainterInfo & pi, int x, int y) const
{ {
// setRedrawBackground(false);
use_preview_ = previewState(pi.base.bv); 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_) { if (use_preview_) {
// one pixel gap in front // one pixel gap in front

View File

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

View File

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