Permalink
Browse files

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.
  • Loading branch information...
digitall committed Oct 11, 2018
1 parent 6fc08fd commit efcd857083122a669d9ba54d34a4b7aae07c245b
Showing with 10 additions and 0 deletions.
  1. +4 −0 gui/unknown-game-dialog.cpp
  2. +1 −0 gui/unknown-game-dialog.h
  3. +4 −0 gui/widgets/scrollcontainer.cpp
  4. +1 −0 gui/widgets/scrollcontainer.h
@@ -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();
@@ -37,6 +37,7 @@ class UnknownGameDialog : public Dialog {
public:
UnknownGameDialog(const DetectionResults &detectionResults);
void handleMouseWheel(int x, int y, int direction);
private:
void rebuild();
@@ -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;
@@ -50,6 +50,7 @@ class ScrollContainerWidget: public Widget, public CommandSender {
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.

0 comments on commit efcd857

Please sign in to comment.