summaryrefslogtreecommitdiff
path: root/src/gui/smileycontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/smileycontainer.cpp')
-rw-r--r--src/gui/smileycontainer.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/smileycontainer.cpp b/src/gui/smileycontainer.cpp
index d5e2e815..afe4ce15 100644
--- a/src/gui/smileycontainer.cpp
+++ b/src/gui/smileycontainer.cpp
@@ -26,6 +26,7 @@
#include "../graphics.h"
#include "../log.h"
+#include "../smileyshortcut.h"
#include "../resources/image.h"
#include "../resources/iteminfo.h"
@@ -159,7 +160,10 @@ void SmileyContainer::mousePressed(gcn::MouseEvent &event)
int mx = event.getX();
int my = event.getY();
int index = mx / gridWidth + ((my / gridHeight) * columns);
-
- setSelectedItemIndex(index);
+ if (index <mMaxSmiley)
+ {
+ setSelectedItemIndex(index);
+ smileyShortcut->setSmileySelected(index+1);
+ }
}
}