FlexBox and Grid Layouts support - #169
Open
kunitoki wants to merge 2 commits into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #169 +/- ##
==========================================
+ Coverage 80.58% 80.70% +0.12%
==========================================
Files 777 781 +4
Lines 80278 80842 +564
==========================================
+ Hits 64689 65243 +554
- Misses 15589 15599 +10
... and 8 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a comprehensive and flexible CSS-like layout system to the codebase, centered around new
FlexBoxandFlexItemclasses. It also adds an extensiveLayoutexample to the graphics demos and brings several improvements and bug fixes to layout behavior, especially for flex and grid containers.The most important changes are:
New Layout System:
FlexBoxandFlexItemclasses, providing a CSS Flexbox-inspired layout engine for arranging components with flexible sizing, alignment, wrapping, and ordering. Includes full API documentation and helper methods for common layout patterns. (modules/yup_gui/layout/yup_FlexBox.h[1]modules/yup_gui/layout/yup_FlexItem.h[2]modules/yup_gui/layout/yup_FlexItem.cpp[3]Examples and Demo Integration:
Layoutexample toexamples/graphics, showcasing FlexBox and Grid layout features such as direction, wrapping, alignment, flexible sizing, grid track sizing, placement, and nesting. Integrated this example into the graphics demo selector. (CHANGELOG.md[1]examples/graphics/source/main.cpp[2] [3]Layout Engine Improvements and Bug Fixes:
FlexBoxwhere thegapwas incorrectly applied after the last item on each line, which previously caused overflow and clipping issues. (CHANGELOG.mdCHANGELOG.mdR155)FlexBoxandGridbehavior: flex-shrink is now correctly applied on overflow, wrapReverse is supported, min/max constraints are clamped for all alignments, and items with unspecified sizes now default to the component's bounds rather than collapsing. Added percentage sizing support and improved baseline alignment. Grid auto-placement and sizing fields were also introduced. (CHANGELOG.mdCHANGELOG.mdR331-R338)These changes significantly improve the flexibility, correctness, and usability of the GUI layout system, enabling advanced UI layouts in applications.