From 81fe0fe63297c2b68756f2ed1b221face2d8b5df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Fri, 29 May 2026 02:12:48 -0300 Subject: [PATCH] Minor change in body min-height property. --- include/eepp/ui/uirichtext.hpp | 1 + src/eepp/ui/uirichtext.cpp | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/eepp/ui/uirichtext.hpp b/include/eepp/ui/uirichtext.hpp index ac24b24f5..bca520204 100644 --- a/include/eepp/ui/uirichtext.hpp +++ b/include/eepp/ui/uirichtext.hpp @@ -234,6 +234,7 @@ class EE_API UIHTMLBody : public UIRichText { protected: bool mPropagatedBackground{ false }; + StyleSheetLength mMinHeightLocal; UIHTMLBody( const std::string& tag = "body" ); }; diff --git a/src/eepp/ui/uirichtext.cpp b/src/eepp/ui/uirichtext.cpp index 3c53f2410..33ef081a8 100644 --- a/src/eepp/ui/uirichtext.cpp +++ b/src/eepp/ui/uirichtext.cpp @@ -157,6 +157,9 @@ bool UIHTMLBody::applyProperty( const StyleSheetProperty& attribute ) { } break; } + case PropertyId::MinHeight: + mMinHeightLocal = attribute.asStyleSheetLength(); + return true; default: break; } @@ -167,12 +170,16 @@ bool UIHTMLBody::applyProperty( const StyleSheetProperty& attribute ) { void UIHTMLBody::updateLayout() { UIRichText::updateLayout(); - if ( mStyle->getProperty( PropertyId::MinHeight ) ) - return; - if ( mChild && mChild->isWidget() ) { Float maxH = 0; Node* child = mChild; + Float minHeight = std::max( + mMinHeightLocal.asPixels( + getParent()->isUINode() ? getParent()->asType()->getPixelsSize().getHeight() + : getParent()->getSize().getHeight(), + getSceneNode()->getPixelsSize(), getSceneNode()->getDPI() ), + getMinSize().getHeight() ); + while ( child ) { if ( child->isWidget() ) { UIWidget* widget = child->asType(); @@ -191,7 +198,7 @@ void UIHTMLBody::updateLayout() { } if ( maxH > 0 ) { Float dpH = std::trunc( PixelDensity::pxToDp( maxH ) ); - if ( dpH != getMinSize().getHeight() ) + if ( dpH != minHeight ) setMinHeight( dpH ); } }