Loading

Paste #pnni5r3vm

  1. diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
  2. index 3a903fb..6763c6a 100644
  3. --- a/src/rail_gui.cpp
  4. +++ b/src/rail_gui.cpp
  5. @@ -1028,21 +1028,23 @@ public:
  6.  
  7.         this->DrawWidgets();
  8.  
  9. -       /* 'Accepts' and 'Supplies' texts. */
  10. -       NWidgetBase *cov = this->GetWidget<NWidgetBase>(WID_BRAS_COVERAGE_TEXTS);
  11. -       int top = cov->pos_y + WD_PAR_VSEP_NORMAL;
  12. -       int left = cov->pos_x + WD_FRAMERECT_LEFT;
  13. -       int right = cov->pos_x + cov->current_x - WD_FRAMERECT_RIGHT;
  14. -       int bottom = cov->pos_y + cov->current_y;
  15. -       top = DrawStationCoverageAreaText(left, right, top, SCT_ALL, rad, false) + WD_PAR_VSEP_NORMAL;
  16. -       top = DrawStationCoverageAreaText(left, right, top, SCT_ALL, rad, true) + WD_PAR_VSEP_NORMAL;
  17. -       /* Resize background if the window is too small.
  18. -        * Never make the window smaller to avoid oscillating if the size change affects the acceptance.
  19. -        * (This is the case, if making the window bigger moves the mouse into the window.) */
  20. -       if (top > bottom) {
  21. -           this->coverage_height += top - bottom;
  22. -           this->ReInit();
  23. -       }
  24. +        if (!this->IsShaded()) {
  25. +            /* 'Accepts' and 'Supplies' texts. */
  26. +            NWidgetBase *cov = this->GetWidget<NWidgetBase>(WID_BRAS_COVERAGE_TEXTS);
  27. +            int top = cov->pos_y + WD_PAR_VSEP_NORMAL;
  28. +            int left = cov->pos_x + WD_FRAMERECT_LEFT;
  29. +            int right = cov->pos_x + cov->current_x - WD_FRAMERECT_RIGHT;
  30. +            int bottom = cov->pos_y + cov->current_y;
  31. +            top = DrawStationCoverageAreaText(left, right, top, SCT_ALL, rad, false) + WD_PAR_VSEP_NORMAL;
  32. +            top = DrawStationCoverageAreaText(left, right, top, SCT_ALL, rad, true) + WD_PAR_VSEP_NORMAL;
  33. +            /* Resize background if the window is too small.
  34. +             * Never make the window smaller to avoid oscillating if the size change affects the acceptance.
  35. +             * (This is the case, if making the window bigger moves the mouse into the window.) */
  36. +            if (top > bottom) {
  37. +                this->coverage_height += top - bottom;
  38. +                this->ReInit();
  39. +            }
  40. +        }
  41.     }
  42.  
  43.     virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
  44. @@ -1377,6 +1379,7 @@ static const NWidgetPart _nested_station_builder_widgets[] = {
  45.     NWidget(NWID_HORIZONTAL),
  46.         NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
  47.         NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_STATION_BUILD_RAIL_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
  48. +       NWidget(WWT_SHADEBOX, COLOUR_DARK_GREEN),
  49.         NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BRAS_SHOW_NEWST_DEFSIZE),
  50.             NWidget(WWT_DEFSIZEBOX, COLOUR_DARK_GREEN),
  51.         EndContainer(),

Comments