(svn r19558) -Fix [FS#3730]: Window::OnResize() was not always called while resizing a window.

This commit is contained in:
alberth 2010-04-04 11:21:56 +00:00
parent 4441fee0f5
commit 6934e6fe7d

View File

@ -548,8 +548,7 @@ void Window::ReInit(int rx, int ry)
if (this->resize.step_height > 1) dy -= dy % (int)this->resize.step_height; if (this->resize.step_height > 1) dy -= dy % (int)this->resize.step_height;
ResizeWindow(this, dx, dy); ResizeWindow(this, dx, dy);
this->OnResize(); /* ResizeWindow() does this->SetDirty() already, no need to do it again here. */
this->SetDirty();
} }
/** Set the shaded state of the window to \a make_shaded. /** Set the shaded state of the window to \a make_shaded.
@ -962,11 +961,12 @@ void Window::FindWindowPlacementAndResize(int def_width, int def_height)
if (this->resize.step_height > 1) enlarge_y -= enlarge_y % (int)this->resize.step_height; if (this->resize.step_height > 1) enlarge_y -= enlarge_y % (int)this->resize.step_height;
ResizeWindow(this, enlarge_x, enlarge_y); ResizeWindow(this, enlarge_x, enlarge_y);
/* ResizeWindow() calls this->OnResize(). */
} else {
/* Always call OnResize; that way the scrollbars and matrices get initialized. */
this->OnResize();
} }
/* Always call OnResize; that way the scrollbars and matrices get initialized */
this->OnResize();
int nx = this->left; int nx = this->left;
int ny = this->top; int ny = this->top;
@ -1425,6 +1425,7 @@ void ResizeWindow(Window *w, int delta_x, int delta_y)
w->nested_root->AssignSizePosition(ST_RESIZE, 0, 0, w->nested_root->smallest_x + new_xinc, w->nested_root->smallest_y + new_yinc, _dynlang.text_dir == TD_RTL); w->nested_root->AssignSizePosition(ST_RESIZE, 0, 0, w->nested_root->smallest_x + new_xinc, w->nested_root->smallest_y + new_yinc, _dynlang.text_dir == TD_RTL);
w->width = w->nested_root->current_x; w->width = w->nested_root->current_x;
w->height = w->nested_root->current_y; w->height = w->nested_root->current_y;
w->OnResize();
w->SetDirty(); w->SetDirty();
} }
@ -1679,7 +1680,6 @@ static bool HandleWindowDragging()
/* ResizeWindow sets both pre- and after-size to dirty for redrawal */ /* ResizeWindow sets both pre- and after-size to dirty for redrawal */
ResizeWindow(w, x, y); ResizeWindow(w, x, y);
w->OnResize();
return false; return false;
} }
} }
@ -2548,10 +2548,7 @@ void RelocateAllWindows(int neww, int newh)
* in a 'backup'-desc that the window should always be centred. */ * in a 'backup'-desc that the window should always be centred. */
switch (w->window_class) { switch (w->window_class) {
case WC_MAIN_TOOLBAR: case WC_MAIN_TOOLBAR:
if (neww - w->width != 0) { if (neww - w->width != 0) ResizeWindow(w, min(neww, 640) - w->width, 0);
ResizeWindow(w, min(neww, 640) - w->width, 0);
w->OnResize();
}
top = w->top; top = w->top;
left = PositionMainToolbar(w); // changes toolbar orientation left = PositionMainToolbar(w); // changes toolbar orientation