mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Fix usage of left/right button to select amounts, e.g. in recruit screen
This commit is contained in:
@@ -460,7 +460,7 @@ void SelectionTab::updateListItems()
|
|||||||
bool SelectionTab::receiveEvent(const Point & position, int eventType) const
|
bool SelectionTab::receiveEvent(const Point & position, int eventType) const
|
||||||
{
|
{
|
||||||
// FIXME: widget should instead have well-defined pos so events will be filtered using standard routine
|
// FIXME: widget should instead have well-defined pos so events will be filtered using standard routine
|
||||||
return getLine(position) != -1;
|
return getLine(position - pos.topLeft()) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SelectionTab::getLine() const
|
int SelectionTab::getLine() const
|
||||||
|
@@ -214,6 +214,10 @@ CSlider::CSlider(Point position, int totalw, std::function<void(int)> Moved, int
|
|||||||
pos.h = totalw;
|
pos.h = totalw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for horizontal sliders that act as values selection - add keyboard event to receive left/right click
|
||||||
|
if (getOrientation() == Orientation::HORIZONTAL)
|
||||||
|
addUsedEvents(KEYBOARD);
|
||||||
|
|
||||||
updateSliderPos();
|
updateSliderPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user