<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40328 >

2008/6/26 [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=40328 >
>
> This transaction appears to have no content
>
>
>
>  Attached are screenshots of the city list view (F1) in the SDL client 
> showing at various stages in the game.  As the number of cities you own 
> increases the area used for actually showing the city list decreases, until 
> after you have around 60 or so cities, you can't see any of them.
>
>
>
> Version information:
>
> Built on PCLinuxOS from source.  I first used 2.1.4 and the problem was 
> there.  I switched to 2.1.5 and the problem remains.
>

Patch attached.

Index: client/gui-sdl/cityrep.c
===================================================================
--- client/gui-sdl/cityrep.c	(revision 14992)
+++ client/gui-sdl/cityrep.c	(working copy)
@@ -278,7 +278,7 @@
     pBuf->action = popup_citydlg_from_city_report_callback;
     set_wstate(pBuf, FC_WS_NORMAL);
     pBuf->data.city = pCity;
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf , WF_HIDDEN);
     }
     hh = pBuf->size.h;
@@ -291,7 +291,7 @@
     pStr->style |= SF_CENTER;
     pBuf = create_iconlabel(NULL, pWindow->dst, pStr,
 					WF_RESTORE_BACKGROUND);
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -301,7 +301,7 @@
     /* ----------- */
     pBuf = create_checkbox(pWindow->dst,
 	    cma_is_city_under_agent(pCity, NULL), WF_RESTORE_BACKGROUND);
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -317,7 +317,7 @@
     pStr->fgcol = *get_game_colorRGB(COLOR_OVERVIEW_LAND);	
     pBuf = create_iconlabel(NULL, pWindow->dst, pStr,
 					WF_RESTORE_BACKGROUND);
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -331,7 +331,7 @@
     pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_FOOD_SURPLUS);
     pBuf = create_iconlabel(NULL, pWindow->dst, pStr,
 					WF_RESTORE_BACKGROUND);
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -359,7 +359,7 @@
     }
     pBuf = create_iconlabel(NULL, pWindow->dst, pStr,
 					WF_RESTORE_BACKGROUND);
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -373,7 +373,7 @@
     pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_TRADE);
     pBuf = create_iconlabel(NULL, pWindow->dst, pStr,
 					WF_RESTORE_BACKGROUND);
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -386,7 +386,7 @@
     pStr->style |= SF_CENTER;
     pBuf = create_iconlabel(NULL, pWindow->dst, pStr,
 					WF_RESTORE_BACKGROUND);
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -400,7 +400,7 @@
     pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_GOLD);
     pBuf = create_iconlabel(NULL, pWindow->dst, pStr,
 					WF_RESTORE_BACKGROUND);
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -414,7 +414,7 @@
     pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_SCIENCE);
     pBuf = create_iconlabel(NULL, pWindow->dst, pStr,
 					WF_RESTORE_BACKGROUND);
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -428,7 +428,7 @@
     pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_LUX);
     pBuf = create_iconlabel(NULL, pWindow->dst, pStr,
 					WF_RESTORE_BACKGROUND);
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -443,7 +443,7 @@
     pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_PROD);
     pBuf = create_iconlabel(NULL, pWindow->dst, pStr,
 					WF_RESTORE_BACKGROUND);
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -456,7 +456,7 @@
     pStr->style |= SF_CENTER;
     pBuf = create_iconlabel(NULL, pWindow->dst, pStr,
 					WF_RESTORE_BACKGROUND);
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -471,7 +471,7 @@
     pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_SUPPORT);
     pBuf = create_iconlabel(NULL, pWindow->dst, pStr,
 					WF_RESTORE_BACKGROUND);
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -485,7 +485,7 @@
     pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_TRADE);
     pBuf = create_iconlabel(NULL, pWindow->dst, pStr,
 					WF_RESTORE_BACKGROUND);
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -495,11 +495,15 @@
     /* ----------- */
     if(pCity->production.is_unit) {
       struct unit_type *pUnitType = utype_by_number(pCity->production.value);
-      pLogo = ResizeSurface(get_unittype_surface(pUnitType), adj_size(36), adj_size(24), 1);      
+      pLogo = ResizeSurfaceBox(get_unittype_surface(pUnitType),
+                               adj_size(36), adj_size(24), 1,
+                               TRUE, TRUE);      
       togrow = unit_build_shield_cost(pUnitType);
       pName = utype_name_translation(pUnitType);
     } else {
-      pLogo = ResizeSurface(get_building_surface(pCity->production.value), adj_size(36), adj_size(24), 1);
+      pLogo = ResizeSurfaceBox(get_building_surface(pCity->production.value),
+                               adj_size(36), adj_size(24), 1,
+                               TRUE, TRUE);
       togrow = impr_build_shield_cost(pCity->production.value);
       pName = improvement_name_translation(pCity->production.value);
     }
@@ -535,7 +539,7 @@
     pBuf = create_icon2(pLogo, pWindow->dst,
     	(WF_WIDGET_HAS_INFO_LABEL|WF_RESTORE_BACKGROUND|WF_FREE_THEME));
     pBuf->string16 = pStr;
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -549,7 +553,7 @@
     pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYREP_TEXT);
     pBuf = create_iconlabel(NULL, pWindow->dst, pStr,
 			(WF_SELLECT_WITHOUT_BAR|WF_RESTORE_BACKGROUND));
-    if(count > 9 * COL) {
+    if(count > 13 * COL) {
       set_wflag(pBuf, WF_HIDDEN);
     }
     hh = MAX(hh, pBuf->size.h);
@@ -562,7 +566,6 @@
     }
     
     count += COL;
-    area.h += (hh + adj_size(2));
   } city_list_iterate_end;
   
   H = hh;
@@ -575,18 +578,20 @@
   if(count) {
     pCityRep->pEndActiveWidgetList = pLast->prev;
     pCityRep->pBeginActiveWidgetList = pCityRep->pBeginWidgetList;
-    if(count > 10 * COL) {
+    if(count > 14 * COL) {
       pCityRep->pActiveWidgetList = pCityRep->pEndActiveWidgetList;
       if(pCityRep->pScroll) {
 	pCityRep->pScroll->count = count;
       }
-      ww = create_vertical_scrollbar(pCityRep, COL, 10, TRUE, TRUE);
+      ww = create_vertical_scrollbar(pCityRep, COL, 14, TRUE, TRUE);
       area.w += ww;
-      area.h = MAX(area.h, (10 * (hh + adj_size(2))));
+      area.h = 14 * (hh + adj_size(2));
+    } else {
+      area.h = (count / COL) * (hh + adj_size(2));
     }
   }
   
-  area.h += pText2->h + adj_size(40);
+  area.h += pText2->h + adj_size(6);
   area.w += adj_size(2);
   
   pLogo = theme_get_background(theme, BACKGROUND_CITYREP);
@@ -638,7 +643,7 @@
   dst.x = area.x + adj_size(2);
   dst.y = area.y + 1;
   dst.w = (name_w + adj_size(6)) + (pText1->w + adj_size(8)) + adj_size(5);
-  dst.h = area.h - adj_size(33);
+  dst.h = area.h - adj_size(2);
   SDL_FillRectAlpha(pWindow->theme, &dst, &bg_color);
   
   putframe(pWindow->theme, dst.x , dst.y, dst.x + dst.w, dst.y + dst.h - 1,
@@ -670,7 +675,7 @@
   dst.w = (pIcons->pBIG_Food->w + adj_size(6)) + adj_size(10) +
 	  (pIcons->pBIG_Food_Surplus->w + adj_size(6)) + adj_size(10) +
 	  			pText2->w + adj_size(6 + 2);
-  dst.h = area.h - adj_size(33);
+  dst.h = area.h - adj_size(2);
   SDL_FillRectAlpha(pWindow->theme, &dst, get_game_colorRGB(COLOR_THEME_CITYREP_FOODSTOCK));
   
   putframe(pWindow->theme, dst.x , dst.y, dst.x + dst.w, dst.y + dst.h - 1,
@@ -704,7 +709,7 @@
 	  (pIcons->pBIG_Coin->w + adj_size(6)) + adj_size(10) +
 	  (pIcons->pBIG_Colb->w + adj_size(6)) + adj_size(10) +
 	  (pIcons->pBIG_Luxury->w + adj_size(6)) + adj_size(4);
-  dst.h = area.h - adj_size(33);
+  dst.h = area.h - adj_size(2);
   
   SDL_FillRectAlpha(pWindow->theme, &dst, get_game_colorRGB(COLOR_THEME_CITYREP_TRADE));
   
@@ -741,7 +746,7 @@
 	  (pIcons->pBIG_Shield_Corr->w + adj_size(6)) + adj_size(10) +
 	  (pUnits_Icon->w + adj_size(6)) + adj_size(10) +
 	  (pIcons->pBIG_Shield_Surplus->w + adj_size(6)) + adj_size(4);
-  dst.h = area.h - adj_size(33);
+  dst.h = area.h - adj_size(2);
   
   SDL_FillRectAlpha(pWindow->theme, &dst, get_game_colorRGB(COLOR_THEME_CITYREP_PROD));
   
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to