Codechange: Add method to resize both width and height of a widget.

wip-string
Peter Nelson 7 months ago committed by Peter Nelson
parent d04fd4602d
commit f281525492

@ -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.
*/

@ -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;

Loading…
Cancel
Save