QmlMaterial 0.1.0
Loading...
Searching...
No Matches
carousel_scroll_strategy.hpp
1#pragma once
2
3#include "qml_material/carousel/carousel_keylines.hpp"
4#include "qml_material/carousel/carousel_strategy.hpp"
5
6namespace qml_material
7{
8
9struct CarouselScrollStrategy {
10 KeylineList default_keylines;
11 QVector<KeylineList> start_steps;
12 QVector<KeylineList> end_steps;
13 qreal start_shift_distance = 0;
14 qreal end_shift_distance = 0;
15 bool centered_hero = false;
16 qreal viewport_size = 0;
17 QVector<qreal> end_shift_points;
18
19 static auto build(const CarouselLayoutInput& in, const KeylineList& default_keylines)
20 -> CarouselScrollStrategy;
21
22 auto keylinesForScrollOffset(qreal scroll_offset, qreal max_scroll_offset,
23 bool round_to_step = false) const -> KeylineList;
24
25 auto snapOffsets(const CarouselLayoutInput&) const -> QVector<qreal>;
26 auto initialCenter(const CarouselLayoutInput&) const -> qreal;
27};
28
29} // namespace qml_material