Fixed subsidies window list height
This commit is contained in:
+8
-6
@@ -133,6 +133,7 @@ struct SubsidyListWindow : Window {
|
||||
{
|
||||
if (widget != WID_SUL_PANEL) return;
|
||||
Dimension d = maxdim(GetStringBoundingBox(STR_SUBSIDIES_OFFERED_TITLE), GetStringBoundingBox(STR_SUBSIDIES_SUBSIDISED_TITLE));
|
||||
d.height = GetMinSizing(NWST_STEP, d.height);
|
||||
|
||||
resize->height = d.height;
|
||||
|
||||
@@ -152,12 +153,13 @@ struct SubsidyListWindow : Window {
|
||||
int right = r.right - WD_FRAMERECT_RIGHT;
|
||||
int y = r.top + WD_FRAMERECT_TOP;
|
||||
int x = r.left + WD_FRAMERECT_LEFT;
|
||||
y = Center(y, GetMinSizing(NWST_STEP));
|
||||
|
||||
int pos = -this->vscroll->GetPosition();
|
||||
const int cap = this->vscroll->GetCapacity();
|
||||
|
||||
/* Section for drawing the offered subsidies */
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_OFFERED_TITLE);
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(x, right, y + pos * GetMinSizing(NWST_STEP), STR_SUBSIDIES_OFFERED_TITLE);
|
||||
pos++;
|
||||
|
||||
uint num = 0;
|
||||
@@ -168,7 +170,7 @@ struct SubsidyListWindow : Window {
|
||||
/* Displays the two offered towns */
|
||||
SetupSubsidyDecodeParam(s, true);
|
||||
SetDParam(7, _date - ymd.day + s->remaining * 32);
|
||||
DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_OFFERED_FROM_TO);
|
||||
DrawString(x, right, y + pos * GetMinSizing(NWST_STEP), STR_SUBSIDIES_OFFERED_FROM_TO);
|
||||
}
|
||||
pos++;
|
||||
num++;
|
||||
@@ -176,13 +178,13 @@ struct SubsidyListWindow : Window {
|
||||
}
|
||||
|
||||
if (num == 0) {
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_NONE);
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(x, right, y + pos * GetMinSizing(NWST_STEP), STR_SUBSIDIES_NONE);
|
||||
pos++;
|
||||
}
|
||||
|
||||
/* Section for drawing the already granted subsidies */
|
||||
pos++;
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_SUBSIDISED_TITLE);
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(x, right, y + pos * GetMinSizing(NWST_STEP), STR_SUBSIDIES_SUBSIDISED_TITLE);
|
||||
pos++;
|
||||
num = 0;
|
||||
|
||||
@@ -194,7 +196,7 @@ struct SubsidyListWindow : Window {
|
||||
SetDParam(8, _date - ymd.day + s->remaining * 32);
|
||||
|
||||
/* Displays the two connected stations */
|
||||
DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_SUBSIDISED_FROM_TO);
|
||||
DrawString(x, right, y + pos * GetMinSizing(NWST_STEP), STR_SUBSIDIES_SUBSIDISED_FROM_TO);
|
||||
}
|
||||
pos++;
|
||||
num++;
|
||||
@@ -202,7 +204,7 @@ struct SubsidyListWindow : Window {
|
||||
}
|
||||
|
||||
if (num == 0) {
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_NONE);
|
||||
if (IsInsideMM(pos, 0, cap)) DrawString(x, right, y + pos * GetMinSizing(NWST_STEP), STR_SUBSIDIES_NONE);
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user