Merge branch 'master' into jgrpp
# Conflicts: # cmake/CompileFlags.cmake # src/aircraft_cmd.cpp # src/blitter/32bpp_anim.cpp # src/cargopacket.cpp # src/cheat_gui.cpp # src/company_cmd.cpp # src/company_gui.cpp # src/core/pool_func.hpp # src/date.cpp # src/economy.cpp # src/error_gui.cpp # src/ground_vehicle.cpp # src/ground_vehicle.hpp # src/group_gui.cpp # src/industry_cmd.cpp # src/lang/dutch.txt # src/lang/french.txt # src/lang/german.txt # src/linkgraph/linkgraph_gui.cpp # src/linkgraph/mcf.cpp # src/network/network_content.cpp # src/network/network_server.cpp # src/network/network_udp.cpp # src/newgrf_engine.cpp # src/newgrf_station.cpp # src/order_cmd.cpp # src/order_gui.cpp # src/pathfinder/follow_track.hpp # src/pathfinder/yapf/yapf_common.hpp # src/saveload/saveload.cpp # src/settings_gui.cpp # src/station_cmd.cpp # src/station_kdtree.h # src/string_func.h # src/table/settings.ini # src/tgp.cpp # src/timetable_cmd.cpp # src/timetable_gui.cpp # src/toolbar_gui.cpp # src/town_cmd.cpp # src/train_cmd.cpp # src/train_gui.cpp # src/tree_gui.cpp # src/tunnelbridge_cmd.cpp # src/vehicle.cpp # src/vehicle_gui.cpp # src/video/sdl2_v.cpp # src/video/sdl_v.cpp # src/video/win32_v.cpp # src/viewport.cpp # src/viewport_sprite_sorter_sse4.cpp # src/window.cpp
This commit is contained in:
@@ -491,7 +491,7 @@ public:
|
||||
this->EnableWidget(WID_DB_SHOW_DEPS);
|
||||
}
|
||||
|
||||
this->vscroll->SetCount(min(_settings_client.gui.max_departures, this->departures->size() + this->arrivals->size()));
|
||||
this->vscroll->SetCount(std::min<uint>(_settings_client.gui.max_departures, this->departures->size() + this->arrivals->size()));
|
||||
this->DrawWidgets();
|
||||
}
|
||||
|
||||
@@ -548,9 +548,9 @@ void DeparturesWindow<Twaypoint>::RecomputeDateWidth()
|
||||
cached_date_display_method = _settings_time.time_in_minutes;
|
||||
cached_arr_dep_display_method = _settings_client.gui.departure_show_both;
|
||||
|
||||
cached_status_width = max((GetStringBoundingBox(STR_DEPARTURES_ON_TIME)).width, cached_status_width);
|
||||
cached_status_width = max((GetStringBoundingBox(STR_DEPARTURES_DELAYED)).width, cached_status_width);
|
||||
cached_status_width = max((GetStringBoundingBox(STR_DEPARTURES_CANCELLED)).width, cached_status_width);
|
||||
cached_status_width = std::max((GetStringBoundingBox(STR_DEPARTURES_ON_TIME)).width, cached_status_width);
|
||||
cached_status_width = std::max((GetStringBoundingBox(STR_DEPARTURES_DELAYED)).width, cached_status_width);
|
||||
cached_status_width = std::max((GetStringBoundingBox(STR_DEPARTURES_CANCELLED)).width, cached_status_width);
|
||||
|
||||
uint interval = cached_date_display_method ? _settings_time.ticks_per_minute : DAY_TICKS;
|
||||
uint count = cached_date_display_method ? 24*60 : 365;
|
||||
@@ -558,8 +558,8 @@ void DeparturesWindow<Twaypoint>::RecomputeDateWidth()
|
||||
for (uint i = 0; i < count; ++i) {
|
||||
SetDParam(0, INT_MAX - (i*interval));
|
||||
SetDParam(1, INT_MAX - (i*interval));
|
||||
cached_date_width = max(GetStringBoundingBox(cached_arr_dep_display_method ? STR_DEPARTURES_TIME_BOTH : STR_DEPARTURES_TIME_DEP).width, cached_date_width);
|
||||
cached_status_width = max((GetStringBoundingBox(STR_DEPARTURES_EXPECTED)).width, cached_status_width);
|
||||
cached_date_width = std::max(GetStringBoundingBox(cached_arr_dep_display_method ? STR_DEPARTURES_TIME_BOTH : STR_DEPARTURES_TIME_DEP).width, cached_date_width);
|
||||
cached_status_width = std::max((GetStringBoundingBox(STR_DEPARTURES_EXPECTED)).width, cached_status_width);
|
||||
}
|
||||
|
||||
SetDParam(0, 0);
|
||||
@@ -623,7 +623,7 @@ void DeparturesWindow<Twaypoint>::DrawDeparturesListItems(const Rect &r) const
|
||||
int text_right = right - (rtl ? text_offset : 0);
|
||||
|
||||
int y = r.top + 1;
|
||||
uint max_departures = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->departures->size() + this->arrivals->size());
|
||||
uint max_departures = std::min<uint>(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->departures->size() + this->arrivals->size());
|
||||
|
||||
if (max_departures > _settings_client.gui.max_departures) {
|
||||
max_departures = _settings_client.gui.max_departures;
|
||||
|
Reference in New Issue
Block a user