Feature/add carousel#18
Open
EdwardAbrosimov wants to merge 11 commits into
Open
Conversation
added 11 commits
June 16, 2026 10:37
- Added carousel layout enums and tokens for better customization. - Updated example files to demonstrate carousel functionality with various layouts. - Included new carousel images in the resource files. - Adjusted CMakeLists to include carousel sources and resources.
…ayout enum for uncontained multi-aspect carousels, updated CarouselImageDelegate to handle aspect ratios, and modified CarouselView to accommodate variable item widths. Updated example scenes to demonstrate new layout capabilities.
…accessibility and keyboard navigation. Added properties for carousel count, orientation, and current index. Implemented keyboard navigation methods and focus management in CarouselView and CarouselItem. Updated QML components to support new features and improve user experience.
…er radius. Updated corner properties to dynamically adjust based on visible dimensions, enhancing visual consistency and responsiveness in the carousel layout. Hero start-aligned works fine.
…nd structures for hero keylines and scroll strategies, enhancing layout transitions and item sizing. Implemented hero center layout logic in CarouselView and added corresponding tests to validate functionality.
… layout logic for full-screen items, updated CarouselView to handle full-screen layout interactions, and modified example scenes to showcase the new layout. Introduced tests to validate full-screen functionality and ensure correct item sizing and snapping behavior.
…ht calculations and content management. Updated implicit height properties to use contentImplicitHeight and scrollExtent for better responsiveness. Enhanced VerticalFlickable with viewportHeight and implicitContentHeight properties for improved layout handling.
…ting carousel model handling. Enhanced CarouselView to support item model binding and improved layout synchronization. Updated example scenes to utilize new CarouselDemoData for carousel items, ensuring better data management and responsiveness.
- Introduced `carousel_engine_defaults.cpp` to validate default values against `TokenCarouselLiterals`. - Added `model_data_changed.cpp` to test the interaction between a custom list model and the `CarouselView`, ensuring data updates reflect correctly in the UI. - Implemented a test structure for verifying carousel item behavior and model binding.
- Added new property for horizontal scroll modifiers in WheelHandler. - Implemented getter, setter, and reset methods for horizontal scroll modifiers. - Updated scroll handling logic to utilize horizontal scroll modifiers for improved interaction. - Modified Carousel.qml to integrate horizontal scroll handling with shift key requirement for better user experience.
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.
Summary
Adds
MD.Carouselfollowing Material 3 Carousel, with a C++ layout engine, snap scrolling, and an accessibility-focused QML wrapper.CarouselView+ keylines / scroll strategy — item sizing, parallax, masks, snap offsetsMD.Carousel,MD.CarouselItem,MD.CarouselImageDelegate; tokens inMD.Token.carouselAccessibleCarouselFullScreen→ wheel without modifiers (including vertical)horizontalScrollModifiers: NoModifier)int,QVariantList, JS array,QAbstractItemModel(includingdataChangedand count shrink)example/Components.qml+CarouselDemoData.qmland sample imagesWheelHandler(QQmlContext fallback,horizontalScrollModifiers),VerticalFlickable(viewportHeight),NavigationRail/StandardDrawer(implicit height),FocusIndicatorArchitecture
qml/control/Carousel.qmlqml/component/carousel/CarouselItem.qml,CarouselImageDelegate.qmlsrc/carousel/carousel_view.cppcarousel_keylines.cpp,carousel_scroll_strategy.cpp,carousel_strategy.hppcarousel_attached.cpp(keyboard / focus hooks)CarouselLayoutIdincarousel_strategy.hppis kept in sync withMD.Enum.CarouselLayout;CarouselEngineDefaultsis validated viastatic_assertin tests.Wheel / input (review focus)
Previously
MD.WheelHandlerscrolled the flickable directly — on Full-screen vertical this produced intermediate positions between snap points. Now:scrollFlickableTarget: falseonWheel→incrementCurrentIndex()/decrementCurrentIndex()→ animated snap in C++Demo assets
Abstract images under
example/assets/carousel/were generated programmatically (procedural / code-generated artwork). They are used only for demos and tests and carry no third-party copyright.Layout demos (screencasts)
Uncontained — fixed width
CarouselUncontained· horizontal · equal item width · peek at trailing edgeScreencast.from.2026-06-18.15-34-53.mp4
Uncontained — multi-aspect
CarouselUncontainedMultiAspect· horizontal · per-item aspect ratio · variable item widthsScreencast.from.2026-06-18.15-46-19.mp4
Multi-browse
CarouselMultiBrowse· horizontal · large / medium / small size classes · page indicator + nav buttonsScreencast.from.2026-06-18.15-49-45.mp4
Hero — start-aligned
CarouselHero· horizontal · dominant start item · trailing peekScreencast.from.2026-06-18.15-54-14.mp4
Hero — center-aligned
CarouselHeroCenter· horizontal · centered large item · peeks on both sidesScreencast.from.2026-06-18.15-55-49.mp4
Full-screen — vertical
CarouselFullScreen· vertical · one edge-to-edge item per page · wheel without ShiftScreencast.from.2026-06-18.15-58-47.mp4
Tests
Unit / integration (headless, except View tests):
ctest -R "hero_center_end|hero_start_layout|fullscreen_layout|multi_browse_layout|uncontained_layout|set_current_index_sync|model_shrink|model_data_changed|carousel_engine_defaults"Visual:
tests/scenes/carousel.qml(ctest targetcarousel).Test plan
qm_example→ Components → Carousel: all 6 layoutscurrentIndexctest(command above) — greencurrentIndexout of range