This patch adds the shade widget to that window.
Code: Select all
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index 3a903fb..6763c6a 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -1028,21 +1028,23 @@ public:
this->DrawWidgets();
- /* 'Accepts' and 'Supplies' texts. */
- NWidgetBase *cov = this->GetWidget<NWidgetBase>(WID_BRAS_COVERAGE_TEXTS);
- int top = cov->pos_y + WD_PAR_VSEP_NORMAL;
- int left = cov->pos_x + WD_FRAMERECT_LEFT;
- int right = cov->pos_x + cov->current_x - WD_FRAMERECT_RIGHT;
- int bottom = cov->pos_y + cov->current_y;
- top = DrawStationCoverageAreaText(left, right, top, SCT_ALL, rad, false) + WD_PAR_VSEP_NORMAL;
- top = DrawStationCoverageAreaText(left, right, top, SCT_ALL, rad, true) + WD_PAR_VSEP_NORMAL;
- /* Resize background if the window is too small.
- * Never make the window smaller to avoid oscillating if the size change affects the acceptance.
- * (This is the case, if making the window bigger moves the mouse into the window.) */
- if (top > bottom) {
- this->coverage_height += top - bottom;
- this->ReInit();
- }
+ if (!this->IsShaded()) {
+ /* 'Accepts' and 'Supplies' texts. */
+ NWidgetBase *cov = this->GetWidget<NWidgetBase>(WID_BRAS_COVERAGE_TEXTS);
+ int top = cov->pos_y + WD_PAR_VSEP_NORMAL;
+ int left = cov->pos_x + WD_FRAMERECT_LEFT;
+ int right = cov->pos_x + cov->current_x - WD_FRAMERECT_RIGHT;
+ int bottom = cov->pos_y + cov->current_y;
+ top = DrawStationCoverageAreaText(left, right, top, SCT_ALL, rad, false) + WD_PAR_VSEP_NORMAL;
+ top = DrawStationCoverageAreaText(left, right, top, SCT_ALL, rad, true) + WD_PAR_VSEP_NORMAL;
+ /* Resize background if the window is too small.
+ * Never make the window smaller to avoid oscillating if the size change affects the acceptance.
+ * (This is the case, if making the window bigger moves the mouse into the window.) */
+ if (top > bottom) {
+ this->coverage_height += top - bottom;
+ this->ReInit();
+ }
+ }
}
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
@@ -1377,6 +1379,7 @@ static const NWidgetPart _nested_station_builder_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_STATION_BUILD_RAIL_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_SHADEBOX, COLOUR_DARK_GREEN),
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BRAS_SHOW_NEWST_DEFSIZE),
NWidget(WWT_DEFSIZEBOX, COLOUR_DARK_GREEN),
EndContainer(),