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

Fixed slider's behavior, especially for mobile systems

This commit is contained in:
Ivan Savenko
2023-06-22 23:49:38 +03:00
parent 7c5dcfd47b
commit a505cc464e
12 changed files with 44 additions and 15 deletions

View File

@ -92,8 +92,16 @@ CListBox::CListBox(CreateFunc create, Point Pos, Point ItemOffset, size_t Visibl
if(Slider & 1)
{
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 = std::make_shared<CSlider>(
SliderPos.topLeft(),
SliderPos.w,
std::bind(&CListBox::moveToPos, this, _1),
(int)VisibleSize,
(int)TotalSize,
(int)InitialPos,
Slider & 2 ? Orientation::HORIZONTAL : Orientation::VERTICAL,
Slider & 4 ? CSlider::BLUE : CSlider::BROWN
);
slider->setPanningStep(itemOffset.x + itemOffset.y);
}