GUI: Fix Mouse Wheel Input for Unknown Game Dialog.

This should also fix this for other instances of ScrollContainer, though
the dialogs / widgets may require the same change.

This fixes bug Trac #10741.
This commit is contained in:
D G Turner 2018-10-11 05:52:02 +01:00
parent 6fc08fd2b1
commit efcd857083
4 changed files with 10 additions and 0 deletions

View file

@ -81,6 +81,10 @@ UnknownGameDialog::UnknownGameDialog(const DetectionResults &detectionResults) :
rebuild();
}
void UnknownGameDialog::handleMouseWheel(int x, int y, int direction) {
_textContainer->handleMouseWheel(x, y, direction);
}
void UnknownGameDialog::reflowLayout() {
rebuild();
Dialog::reflowLayout();

View file

@ -37,6 +37,7 @@ class UnknownGameDialog : public Dialog {
public:
UnknownGameDialog(const DetectionResults &detectionResults);
void handleMouseWheel(int x, int y, int direction);
private:
void rebuild();

View file

@ -49,6 +49,10 @@ void ScrollContainerWidget::init() {
recalc();
}
void ScrollContainerWidget::handleMouseWheel(int x, int y, int direction) {
_verticalScroll->handleMouseWheel(x, y, direction);
}
void ScrollContainerWidget::recalc() {
int scrollbarWidth = g_gui.xmlEval()->getVar("Globals.Scrollbar.Width", 0);
_limitH = _h;

View file

@ -50,6 +50,7 @@ public:
Common::Rect getClipRect() const override;
void handleMouseWheel(int x, int y, int direction);
protected:
// We overload getChildY to make sure child widgets are positioned correctly.
// Essentially this compensates for the space taken up by the tab title header.