summaryrefslogtreecommitdiff
path: root/src/gui/widgets/listbox.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-17 20:30:52 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-17 20:30:52 +0300
commit1f66ae673801e76f3574944628a7980b9bfbabda (patch)
tree129e320b826382da0603b3eed136f55b50a9d7e7 /src/gui/widgets/listbox.cpp
parentc2efedab22275302f0a10cc197424d345a021d18 (diff)
downloadplus-1f66ae673801e76f3574944628a7980b9bfbabda.tar.gz
plus-1f66ae673801e76f3574944628a7980b9bfbabda.tar.bz2
plus-1f66ae673801e76f3574944628a7980b9bfbabda.tar.xz
plus-1f66ae673801e76f3574944628a7980b9bfbabda.zip
Fix npc menu selection by mouse.
Diffstat (limited to 'src/gui/widgets/listbox.cpp')
-rw-r--r--src/gui/widgets/listbox.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp
index 267f2c8cc..949efe05d 100644
--- a/src/gui/widgets/listbox.cpp
+++ b/src/gui/widgets/listbox.cpp
@@ -42,7 +42,8 @@
float ListBox::mAlpha = 1.0;
ListBox::ListBox(gcn::ListModel *listModel):
- gcn::ListBox(listModel)
+ gcn::ListBox(listModel),
+ mDistributeMousePressed(true)
{
mHighlightColor = Theme::getThemeColor(Theme::HIGHLIGHT);
setForegroundColor(Theme::getThemeColor(Theme::TEXT));
@@ -142,6 +143,14 @@ void ListBox::mouseWheelMovedDown(gcn::MouseEvent &mouseEvent A_UNUSED)
{
}
+void ListBox::mousePressed(gcn::MouseEvent &event)
+{
+ if (mDistributeMousePressed)
+ distributeActionEvent();
+ else
+ mouseDragged(event);
+}
+
void ListBox::mouseDragged(gcn::MouseEvent &event)
{
if (event.getButton() != gcn::MouseEvent::LEFT || getRowHeight() == 0)