diff --git a/ChangeLog b/ChangeLog index 54b1b4eaf3..1e10446b35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-08-25 Juergen Vigna + + * src/lyxscreen.h: add force_clear variable and fuction to force + a clear area when redrawing in LyXText. + + * src/text.C (GetVisibleRow): look if the screen forces a redraw. + 2000-08-25 Lars Gullik Bjønnes * some whitespace and comment changes. diff --git a/src/WorkArea.h b/src/WorkArea.h index df91b43618..18b10611c7 100644 --- a/src/WorkArea.h +++ b/src/WorkArea.h @@ -146,5 +146,7 @@ private: Painter painter_; /// FL_OBJECT * figinset_canvas; + /// if we call redraw with true needed for locking-insets + bool screen_cleared; }; #endif diff --git a/src/frontends/kde/lyxgui.kdevprj b/src/frontends/kde/lyxgui.kdevprj index cfd14cfd34..147a51367a 100644 --- a/src/frontends/kde/lyxgui.kdevprj +++ b/src/frontends/kde/lyxgui.kdevprj @@ -5,7 +5,7 @@ show_outputview=true show_treeview=true header_file=Untitled.h cpp_file=Untitled.cpp -browser_file=file:/usr/doc/qt1x-devel-1.45/qimageio.html +browser_file=file:/usr/doc/qt1x-devel-1.45/qlistbox.html [formcopyright.C] install_location= dist=true diff --git a/src/lyxscreen.h b/src/lyxscreen.h index 89e8cb01f1..5a4dc7f2ba 100644 --- a/src/lyxscreen.h +++ b/src/lyxscreen.h @@ -84,6 +84,8 @@ public: If text->status is LyXText::NEED_VERY_LITTLE_REFRESH, we only update the current row. */ void Update(LyXText *, int y_offset=0, int x_offset=0); + /// + bool forceClear() const { return force_clear; } /// bool cursor_visible; @@ -113,6 +115,8 @@ private: int cursor_pixmap_h; /// GC gc_copy; + /// + bool force_clear; }; #endif diff --git a/src/screen.C b/src/screen.C index beaf52d669..38effb1e19 100644 --- a/src/screen.C +++ b/src/screen.C @@ -47,7 +47,7 @@ GC createGC() // Constructor LyXScreen::LyXScreen(WorkArea & o) //, LyXText * text_ptr) - : owner(o) //, text(text_ptr) + : owner(o), force_clear(true) //, text(text_ptr) { // the cursor isnt yet visible cursor_visible = false; @@ -108,7 +108,8 @@ void LyXScreen::DrawFromTo(LyXText * text, int y1, int y2, int y_offset, int x_o y += row->height(); row = row->next(); } - + force_clear = false; + // maybe we have to clear the screen at the bottom if ((y < y2) && text->bv_owner) { owner.getPainter().fillRectangle(0, y, @@ -135,6 +136,7 @@ void LyXScreen::DrawOneRow(LyXText * text, Row * row, long y_text, } while (text->status == LyXText::CHANGED_IN_DRAW); text->status = st; } + force_clear = false; } diff --git a/src/text.C b/src/text.C index 0783fe9753..175ef9e900 100644 --- a/src/text.C +++ b/src/text.C @@ -36,6 +36,7 @@ #include "tracer.h" #include "font.h" #include "encoding.h" +#include "lyxscreen.h" using std::max; using std::min; @@ -3928,12 +3929,13 @@ void LyXText::GetVisibleRow(BufferView * bview, int y_offset, int x_offset, bool clear_area = true; Inset * inset = 0; - if ((last == row_ptr->pos()) && + if (!bview->screen()->forceClear() && (last == row_ptr->pos()) && (row_ptr->par()->GetChar(row_ptr->pos()) == LyXParagraph::META_INSET) && (inset = row_ptr->par()->GetInset(row_ptr->pos()))) { clear_area = inset->doClearArea(); } - if (cleared) { // we don't need to clear it's already done!!! + // we don't need to clear it's already done!!! + if (cleared) { clear_area = true; } else if (clear_area) { int w = (inset_owner ? inset_owner->width(bview, font) : ww);