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.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/smileycontainer.cpp b/src/gui/smileycontainer.cpp
index 5eb99723..55f8f11b 100644
--- a/src/gui/smileycontainer.cpp
+++ b/src/gui/smileycontainer.cpp
@@ -31,6 +31,8 @@
#include "../resources/iteminfo.h"
#include "../resources/resourcemanager.h"
+#include "../smileyshortcut.h"
+
#include "../utils/tostring.h"
const int SmileyContainer::gridWidth = 34; // item icon width + 4
@@ -158,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);
+ }
}
}