diff options
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/listbox.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 239f4784..a3dafe72 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -125,9 +125,14 @@ void ListBox::mousePressed(gcn::MouseEvent &mouseEvent) int y = std::max(0, mouseEvent.getY()); if (y / (int)getRowHeight() < getListModel()->getNumberOfElements()) + { setSelected(y / getRowHeight()); + distributeActionEvent(); + } else + { setSelected(-1); + } } void ListBox::mouseWheelMovedUp(gcn::MouseEvent &mouseEvent) |