|
@@ -193,13 +193,13 @@ static void DispatchMouseWheelEvent(Wind
|
|
|
* XXX - should be rewritten as a widget-dependent scroller but that's
|
|
|
* not happening until someone rewrites the whole widget-code */
|
|
|
if ((sb = &w->vscroll, wi1->type == WWT_SCROLLBAR) || (sb = &w->vscroll2, wi1->type == WWT_SCROLL2BAR) ||
|
|
|
(sb = &w->vscroll2, wi2->type == WWT_SCROLL2BAR) || (sb = &w->vscroll, wi2->type == WWT_SCROLLBAR) ) {
|
|
|
|
|
|
if (sb->count > sb->cap) {
|
|
|
int pos = clamp(sb->pos + wheel, 0, sb->count - sb->cap);
|
|
|
int pos = Clamp(sb->pos + wheel, 0, sb->count - sb->cap);
|
|
|
if (pos != sb->pos) {
|
|
|
sb->pos = pos;
|
|
|
SetWindowDirty(w);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1292,14 +1292,14 @@ static bool HandleWindowDragging()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* Make sure the window doesn't leave the screen
|
|
|
* 13 is the height of the title bar */
|
|
|
nx = clamp(nx, 13 - t->right, _screen.width - 13 - t->left);
|
|
|
ny = clamp(ny, 0, _screen.height - 13);
|
|
|
nx = Clamp(nx, 13 - t->right, _screen.width - 13 - t->left);
|
|
|
ny = Clamp(ny, 0, _screen.height - 13);
|
|
|
|
|
|
/* Make sure the title bar isn't hidden by behind the main tool bar */
|
|
|
v = FindWindowById(WC_MAIN_TOOLBAR, 0);
|
|
|
if (v != NULL) {
|
|
|
int v_bottom = v->top + v->height;
|
|
|
int v_right = v->left + v->width;
|
|
@@ -2110,19 +2110,19 @@ void RelocateAllWindows(int neww, int ne
|
|
|
case WC_NEWS_WINDOW:
|
|
|
top = newh - w->height;
|
|
|
left = (neww - w->width) >> 1;
|
|
|
break;
|
|
|
|
|
|
case WC_STATUS_BAR:
|
|
|
ResizeWindow(w, clamp(neww, 320, 640) - w->width, 0);
|
|
|
ResizeWindow(w, Clamp(neww, 320, 640) - w->width, 0);
|
|
|
top = newh - w->height;
|
|
|
left = (neww - w->width) >> 1;
|
|
|
break;
|
|
|
|
|
|
case WC_SEND_NETWORK_MSG:
|
|
|
ResizeWindow(w, clamp(neww, 320, 640) - w->width, 0);
|
|
|
ResizeWindow(w, Clamp(neww, 320, 640) - w->width, 0);
|
|
|
top = (newh - 26); // 26 = height of status bar + height of chat bar
|
|
|
left = (neww - w->width) >> 1;
|
|
|
break;
|
|
|
|
|
|
case WC_CONSOLE:
|
|
|
IConsoleResize(w);
|