Change: Use scaled WidgetDimensions.
This commit is contained in:
@@ -1405,8 +1405,8 @@ struct GenerateProgressWindow : public Window {
|
||||
SetDParamMaxValue(0, 100);
|
||||
*size = GetStringBoundingBox(STR_GENERATION_PROGRESS);
|
||||
/* We need some spacing for the 'border' */
|
||||
size->height += 8;
|
||||
size->width += 8;
|
||||
size->height += WidgetDimensions::scaled.frametext.Horizontal();
|
||||
size->width += WidgetDimensions::scaled.frametext.Vertical();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1414,7 +1414,7 @@ struct GenerateProgressWindow : public Window {
|
||||
for (uint i = 0; i < GWP_CLASS_COUNT; i++) {
|
||||
size->width = std::max(size->width, GetStringBoundingBox(_generation_class_table[i]).width);
|
||||
}
|
||||
size->height = FONT_HEIGHT_NORMAL * 2 + WD_PAR_VSEP_NORMAL;
|
||||
size->height = FONT_HEIGHT_NORMAL * 2 + WidgetDimensions::scaled.vsep_normal;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1425,7 +1425,7 @@ struct GenerateProgressWindow : public Window {
|
||||
case WID_GP_PROGRESS_BAR: {
|
||||
/* Draw the % complete with a bar and a text */
|
||||
DrawFrameRect(r, COLOUR_GREY, FR_BORDERONLY);
|
||||
Rect br = r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM);
|
||||
Rect br = r.Shrink(WidgetDimensions::scaled.bevel);
|
||||
DrawFrameRect(br.WithWidth(br.Width() * _gws.percent / 100, false), COLOUR_MAUVE, FR_NONE);
|
||||
SetDParam(0, _gws.percent);
|
||||
DrawString(r.left, r.right, CenterBounds(r.top, r.bottom, FONT_HEIGHT_NORMAL), STR_GENERATION_PROGRESS, TC_FROMSTRING, SA_HOR_CENTER);
|
||||
@@ -1439,7 +1439,7 @@ struct GenerateProgressWindow : public Window {
|
||||
/* And say where we are in that class */
|
||||
SetDParam(0, _gws.current);
|
||||
SetDParam(1, _gws.total);
|
||||
DrawString(r.left, r.right, r.top + FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL, STR_GENERATION_PROGRESS_NUM, TC_FROMSTRING, SA_HOR_CENTER);
|
||||
DrawString(r.left, r.right, r.top + FONT_HEIGHT_NORMAL + WidgetDimensions::scaled.vsep_normal, STR_GENERATION_PROGRESS_NUM, TC_FROMSTRING, SA_HOR_CENTER);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user