Fix vertical scrollbar extents in template window info sections

This commit is contained in:
Jonathan G Rennison
2021-08-22 13:52:59 +01:00
parent 5afa1b93eb
commit a4c73e71c3
2 changed files with 15 additions and 12 deletions

View File

@@ -321,12 +321,14 @@ public:
this->vscroll[2]->SetCount(24);
} else {
const TemplateVehicle *tmp = this->templates[this->selected_template_index];
uint min_height = 30;
uint height = 30;
uint height = ScaleGUITrad(8) + (3 * FONT_HEIGHT_NORMAL);
CargoArray cargo_caps;
short count_columns = 0;
short max_columns = 2;
if (tmp->full_weight > tmp->empty_weight || _settings_client.gui.show_train_weight_ratios_in_details) height += FONT_HEIGHT_NORMAL;
if (_settings_game.vehicle.train_acceleration_model != AM_ORIGINAL) height += FONT_HEIGHT_NORMAL;
for (; tmp != nullptr; tmp = tmp->Next()) {
cargo_caps[tmp->cargo_type] += tmp->cargo_cap;
}
@@ -341,8 +343,7 @@ public:
}
}
min_height = std::max(min_height, height);
this->vscroll[2]->SetCount(min_height);
this->vscroll[2]->SetCount(height);
}
this->DrawWidgets();
@@ -774,7 +775,7 @@ public:
}
/* Draw cargo summary */
top += ScaleGUITrad(26);
top += FONT_HEIGHT_NORMAL * 2;
short count_columns = 0;
short max_columns = 2;