Changeset - r13703:15692f1960d7
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-11-22 19:19:11
rubidium@openttd.org
(svn r18238) -Codechange: make the autoreplace window big font aware
1 file changed with 14 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/autoreplace_gui.cpp
Show inline comments
 
@@ -279,6 +279,19 @@ public:
 
				*size = maxdim(*size, d);
 
				break;
 
			}
 

	
 
			case RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN: {
 
				Dimension d = {0, 0};
 
				for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) {
 
					const RailtypeInfo *rti = GetRailTypeInfo(rt);
 
					/* Skip rail type if it has no label */
 
					if (rti->label == 0) continue;
 
					d = maxdim(d, GetStringBoundingBox(rti->strings.replace_text));
 
				}
 
				d.width += padding.width;
 
				d.height += padding.height;
 
				*size = maxdim(*size, d);
 
			} break;
 
		}
 
	}
 

	
 
@@ -317,7 +330,7 @@ public:
 
					SetDParam(0, STR_REPLACE_NOT_REPLACING_VEHICLE_SELECTED);
 
				}
 

	
 
				DrawString(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_BLACK_STRING);
 
				DrawString(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_BLACK_STRING, TC_FROMSTRING, SA_CENTER);
 
				break;
 
			}
 

	
0 comments (0 inline, 0 general)