From 540ed6cce7bdb57da6035e171c9abd55567f7d2f Mon Sep 17 00:00:00 2001 From: pelya Date: Sun, 16 Nov 2014 00:06:43 +0200 Subject: [PATCH] Align all construction windows to the left, to make more space at the center of the screen --- src/rail_gui.cpp | 2 +- src/window.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index b6e0c65ceb..c407585432 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -1483,7 +1483,7 @@ static const NWidgetPart _nested_station_builder_widgets[] = { /** High level window description of the station-build window (default & newGRF) */ static WindowDesc _station_builder_desc( - WDP_AUTO, "build_station_rail", 350, 0, + WDP_AUTO, "build_station_rail", 0, 0, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_station_builder_widgets, lengthof(_nested_station_builder_widgets) diff --git a/src/window.cpp b/src/window.cpp index 38d3fd50e0..a292c9c3fe 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1724,7 +1724,9 @@ static Point LocalGetWindowPlacement(const WindowDesc *desc, int16 sm_width, int pt.x = (_screen.width + 10 - default_width) - 20; } const Window *wt = FindWindowById(WC_MAIN_TOOLBAR_RIGHT, 0); - if (wt && pt.x + default_width > _screen.width - wt->width) { + if (wt && (pt.x + default_width > _screen.width - wt->width || + desc->parent_cls == WC_BUILD_TOOLBAR || desc->parent_cls == WC_SCEN_LAND_GEN)) { + // Move all build toolbar windows to the right, because all build toolbars are always at the right part of the screen pt.x = _screen.width - wt->width - default_width; }