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,6 +172,7 @@ protected:
&& order->GetDestination() == this->station) { && order->GetDestination() == this->station) {
this->vehicles.push_back(v); this->vehicles.push_back(v);
if (_settings_client.gui.departure_show_vehicle) {
if (v->name.empty() && !(v->group_id != DEFAULT_GROUP && _settings_client.gui.vehicle_names != 0)) { if (v->name.empty() && !(v->group_id != DEFAULT_GROUP && _settings_client.gui.vehicle_names != 0)) {
if (v->unitnumber > unitnumber_max[v->type]) unitnumber_max[v->type] = v->unitnumber; if (v->unitnumber > unitnumber_max[v->type]) unitnumber_max[v->type] = v->unitnumber;
} else { } else {
@@ -179,12 +180,15 @@ protected:
int width = (GetStringBoundingBox(STR_DEPARTURES_VEH)).width + 4; int width = (GetStringBoundingBox(STR_DEPARTURES_VEH)).width + 4;
if (width > this->veh_width) this->veh_width = width; 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);
} }
if (_settings_client.gui.departure_show_company) {
SetBit(companies, v->owner); SetBit(companies, v->owner);
}
break; break;
} }
} }