diff --git a/ui/rp_widget.cpp b/ui/rp_widget.cpp index 35fbe2f..a59cb63 100644 --- a/ui/rp_widget.cpp +++ b/ui/rp_widget.cpp @@ -80,7 +80,8 @@ void ToggleChildrenVisibility(not_null widget, bool visible) { void ResizeFitChild( not_null parent, - not_null child) { + not_null child, + int heightMin) { parent->widthValue( ) | rpl::start_with_next([=](int width) { child->resizeToWidth(width); @@ -88,7 +89,7 @@ void ResizeFitChild( child->heightValue( ) | rpl::start_with_next([=](int height) { - parent->resize(parent->width(), height); + parent->resize(parent->width(), std::max(height, heightMin)); }, child->lifetime()); } diff --git a/ui/rp_widget.h b/ui/rp_widget.h index a00282e..347963a 100644 --- a/ui/rp_widget.h +++ b/ui/rp_widget.h @@ -261,7 +261,10 @@ namespace Ui { class RpWidget; -void ResizeFitChild(not_null parent, not_null child); +void ResizeFitChild( + not_null parent, + not_null child, + int heightMin = 0); template using RpWidgetParent = std::conditional_t<