1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Merge pull request #2250 from IvanSavenko/event_handling_fixes

Slider input event fix
This commit is contained in:
Ivan Savenko
2023-06-25 17:39:55 +03:00
committed by GitHub
34 changed files with 133 additions and 154 deletions

View File

@@ -205,8 +205,12 @@ SelectionTab::SelectionTab(ESelectionScreen Type)
listItems.push_back(std::make_shared<ListItem>(Point(30, 129 + i * 25), iconsMapFormats, iconsVictoryCondition, iconsLossCondition));
labelTabTitle = std::make_shared<CLabel>(205, 28, FONT_MEDIUM, ETextAlignment::CENTER, Colors::YELLOW, tabTitle);
slider = std::make_shared<CSlider>(Point(372, 86), tabType != ESelectionScreen::saveGame ? 480 : 430, std::bind(&SelectionTab::sliderMove, this, _1), positionsToShow, (int)curItems.size(), 0, false, CSlider::BLUE);
slider = std::make_shared<CSlider>(Point(372, 86), tabType != ESelectionScreen::saveGame ? 480 : 430, std::bind(&SelectionTab::sliderMove, this, _1), positionsToShow, (int)curItems.size(), 0, Orientation::VERTICAL, CSlider::BLUE);
slider->setPanningStep(24);
// create scroll bounds that encompass all area in this UI element to the left of slider (including area of slider itself)
// entire screen can't be used in here since map description might also have slider
slider->setScrollBounds(Rect(pos.x - slider->pos.x, 0, slider->pos.x + slider->pos.w - pos.x, slider->pos.h ));
filter(0);
}