10namespace CarouselLayoutId
12constexpr int Uncontained = 0;
13constexpr int MultiBrowse = 1;
14constexpr int Hero = 2;
15constexpr int HeroCenter = 3;
16constexpr int FullScreen = 4;
17constexpr int UncontainedMultiAspect = 5;
21struct CarouselEngineDefaults
23 static constexpr qreal min_peek_px = 16;
24 static constexpr qreal parallax_ratio = 0.35;
25 static constexpr qreal parallax_ratio_uncontained = 0.5;
26 static constexpr int snap_duration = 400;
27 static constexpr qreal min_item_aspect = 9.0 / 16.0;
28 static constexpr qreal max_item_aspect = 16.0 / 9.0;
31struct CarouselItemGeometry
38 qreal parallax_shift = 0;
42struct CarouselLayoutInput
45 Qt::Orientation orientation = Qt::Horizontal;
46 qreal viewport_size = 0;
48 qreal scroll_offset = 0;
49 qreal item_extent = 180;
51 qreal small_item_min = 40;
52 qreal small_item_max = 56;
53 qreal content_padding_start = 0;
54 qreal content_padding_end = 0;
55 qreal content_padding_cross = 0;
56 qreal min_peek_px = 16;
57 qreal item_corner_radius = 28;
58 qreal parallax_ratio = 0.35;
59 qreal min_item_aspect = 9.0 / 16.0;
60 qreal max_item_aspect = 16.0 / 9.0;
62 bool reduce_motion =
false;
63 QVector<qreal> item_aspects;
66struct CarouselLayoutOutput
68 QVector<CarouselItemGeometry> items;
70 QVector<qreal> snap_offsets;
71 qreal content_size = 0;
72 qreal max_scroll_offset = 0;
73 qreal end_snap_offset = 0;
74 qreal scroll_step = 0;
75 int leading_index = 0;
81 static auto compute(
const CarouselLayoutInput& input) -> CarouselLayoutOutput;