(svn r8390) -Codechange (r8384): Rewrote ResizeButtons()

Now it only works on first and last widget to resize
  It now works with offsets correctly (no longer assumes the left is 0)
  It's no longer needed to have a widget right of the ones you resize
  Can handle any number of widgets
This commit is contained in:
bjarni
2007-01-24 14:32:20 +00:00
parent 7fffe8b3d4
commit 058df1b99f
5 changed files with 62 additions and 45 deletions

View File

@@ -913,7 +913,7 @@ static void NewVehicleWndProc(Window *w, WindowEvent *e)
break;
case WE_RESIZE:
if (e->we.sizing.diff.x != 0) ResizeButtons(w, BUILD_VEHICLE_WIDGET_BUILD, BUILD_VEHICLE_WIDGET_RESIZE);
if (e->we.sizing.diff.x != 0) ResizeButtons(w, BUILD_VEHICLE_WIDGET_BUILD, BUILD_VEHICLE_WIDGET_RENAME);
if (e->we.sizing.diff.y == 0) break;
w->vscroll.cap += e->we.sizing.diff.y / GetVehicleListHeight(bv->vehicle_type);
@@ -975,7 +975,7 @@ void ShowBuildVehicleWindow(TileIndex tile, byte type)
break;
}
SetupWindowStrings(w, type);
ResizeButtons(w, BUILD_VEHICLE_WIDGET_BUILD, BUILD_VEHICLE_WIDGET_RESIZE);
ResizeButtons(w, BUILD_VEHICLE_WIDGET_BUILD, BUILD_VEHICLE_WIDGET_RENAME);
w->resize.width = w->width;
w->resize.height = w->height;