1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Implemented panning/swiping gesture for sliders

This commit is contained in:
Ivan Savenko
2023-05-29 13:08:08 +03:00
parent 2a30eccb2d
commit 360bf48031
21 changed files with 180 additions and 71 deletions

View File

@ -94,6 +94,8 @@ CListBox::CListBox(CreateFunc create, Point Pos, Point ItemOffset, size_t Visibl
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
slider = std::make_shared<CSlider>(SliderPos.topLeft(), SliderPos.w, std::bind(&CListBox::moveToPos, this, _1),
(int)VisibleSize, (int)TotalSize, (int)InitialPos, Slider & 2, Slider & 4 ? CSlider::BLUE : CSlider::BROWN);
slider->setPanningStep(itemOffset.x + itemOffset.y);
}
reset();
}