Remove obsolete resized_ member.

The need_layout_ member can be used instead so no need for two members
for the same purpose.
This commit is contained in:
Mark de Wever 2009-01-01 15:50:13 +00:00
parent 642ec6a8db
commit a274e8b591
2 changed files with 12 additions and 11 deletions

View file

@ -99,7 +99,6 @@ twindow::twindow(CVideo& video,
, retval_(0)
, owner_(0)
, need_layout_(true)
, resized_(true)
, suspend_drawing_(true)
, top_level_(false)
, restorer_()
@ -220,6 +219,12 @@ int twindow::show(const bool restore, void* /*flip_function*/)
update_screen_size();
}
/*
* Before show has been called, some functions might have done some testing
* on the window and called layout, which can give glitches. So
* reinvalidate the window to avoid those glitches.
*/
invalidate_layout();
suspend_drawing_ = false;
// Start our loop drawing will happen here as well.
@ -256,7 +261,7 @@ void twindow::draw()
surface frame_buffer = video_.getSurface();
/***** ***** Layout and get dirty list ***** *****/
if(resized_ || need_layout_) {
if(need_layout_) {
// Restore old surface. In the future this phase will not be needed
// since all will be redrawn when needed with dirty rects. Since that
// doesn't work yet we need to undraw the window.
@ -276,7 +281,6 @@ void twindow::draw()
// as restore point.
font::draw_floating_labels(frame_buffer);
restorer_ = get_surface_portion(frame_buffer, rect);
resized_ = false;
// Need full redraw so only set ourselves dirty.
dirty_list_.push_back(std::vector<twidget*>(1, this));
@ -379,7 +383,7 @@ void twindow::window_resize(tevent_handler&,
{
settings::screen_width = new_width;
settings::screen_height = new_height;
resized_ = true;
invalidate_layout();
}
void twindow::key_press(tevent_handler& /*event_handler*/, bool& handled,

View file

@ -291,16 +291,13 @@ private:
/** The dialog that owns the window. */
tdialog* owner_;
/** When set the form needs a full layout redraw cycle. */
bool need_layout_;
/**
* When set the window is resized.
* When set the form needs a full layout redraw cycle.
*
* This invalidates the layout background etc. So everything should be
* recalcalated.
* This happens when either a widget changes it's size or visibility or
* the window is resized.
*/
bool resized_;
bool need_layout_;
/** Avoid drawing the window. */
bool suspend_drawing_;