Skip to content

Commit

Permalink
RelativeLayout: hotfix: resize children with MatchParent size policy …
Browse files Browse the repository at this point in the history
…when parent is resized
  • Loading branch information
congard committed Apr 15, 2024
1 parent 77bf6d1 commit ea020af
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/common/core/widgets/RelativeLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,15 @@ void RelativeLayout::onLayout() {
std::list<WidgetInfo> widgetsInfo;

for (auto child : getWidgets()) {
// TODO: hot fix! Verify it!
auto policy_v = child->getVerticalSizePolicy();
auto policy_h = child->getHorizontalSizePolicy();

if (child->isVisible() && (policy_v == SizePolicy::MatchParent || policy_h == SizePolicy::MatchParent)) {
child->forceLayout();
}
//

child->measure();
child->layout();

Expand Down

0 comments on commit ea020af

Please sign in to comment.