diff --git a/src/widget.cpp b/src/widget.cpp index 13fd8315f1..d0e25cc2a6 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -1158,6 +1158,22 @@ void NWidgetResizeBase::SetResize(uint resize_x, uint resize_y) /** * Set absolute (post-scaling) minimal size of the widget. + * The window will need to be reinited if the size is changed. + * @param min_x Horizontal minimal size of the widget. + * @param min_y Vertical minimal size of the widget. + * @return true iff the widget minimum size has changed. + */ +bool NWidgetResizeBase::UpdateSize(uint min_x, uint min_y) +{ + if (min_x == this->min_x && min_y == this->min_y) return false; + this->min_x = min_x; + this->min_y = min_y; + return true; +} + +/** + * Set absolute (post-scaling) minimal size of the widget. + * The window will need to be reinited if the size is changed. * @param min_y Vertical minimal size of the widget. * @return true iff the widget minimum size has changed. */ diff --git a/src/widget_type.h b/src/widget_type.h index 9898520611..dcf2253428 100644 --- a/src/widget_type.h +++ b/src/widget_type.h @@ -262,6 +262,7 @@ public: void SetFill(uint fill_x, uint fill_y); void SetResize(uint resize_x, uint resize_y); + bool UpdateSize(uint min_x, uint min_y); bool UpdateVerticalSize(uint min_y); void AssignSizePosition(SizingType sizing, int x, int y, uint given_width, uint given_height, bool rtl) override;