Departure boards: Do not include hidden columns in minimum window width

This commit is contained in:
Jonathan G Rennison
2023-04-16 18:27:12 +01:00
parent 508f503039
commit 404fb8bae2

View File

@@ -172,19 +172,23 @@ protected:
&& order->GetDestination() == this->station) { && order->GetDestination() == this->station) {
this->vehicles.push_back(v); this->vehicles.push_back(v);
if (v->name.empty() && !(v->group_id != DEFAULT_GROUP && _settings_client.gui.vehicle_names != 0)) { if (_settings_client.gui.departure_show_vehicle) {
if (v->unitnumber > unitnumber_max[v->type]) unitnumber_max[v->type] = v->unitnumber; if (v->name.empty() && !(v->group_id != DEFAULT_GROUP && _settings_client.gui.vehicle_names != 0)) {
} else { if (v->unitnumber > unitnumber_max[v->type]) unitnumber_max[v->type] = v->unitnumber;
SetDParam(0, (uint64)(v->index)); } else {
int width = (GetStringBoundingBox(STR_DEPARTURES_VEH)).width + 4; SetDParam(0, (uint64)(v->index));
if (width > this->veh_width) this->veh_width = width; int width = (GetStringBoundingBox(STR_DEPARTURES_VEH)).width + 4;
if (width > this->veh_width) this->veh_width = width;
}
} }
if (v->group_id != INVALID_GROUP && v->group_id != DEFAULT_GROUP) { if (v->group_id != INVALID_GROUP && v->group_id != DEFAULT_GROUP && _settings_client.gui.departure_show_group) {
groups.insert(v->group_id); groups.insert(v->group_id);
} }
SetBit(companies, v->owner); if (_settings_client.gui.departure_show_company) {
SetBit(companies, v->owner);
}
break; break;
} }
} }