summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-09 23:58:34 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-09 23:58:34 +0300
commitd94f088b0f81fb114980830d8fb53a5ee911b6e6 (patch)
treef2590b2fc54d8fd3f35304cb54045647f34e9589 /src
parente2104c4fffcf86287f4bc7efbed7b3a29839be76 (diff)
downloadmanaplus-d94f088b0f81fb114980830d8fb53a5ee911b6e6.tar.gz
manaplus-d94f088b0f81fb114980830d8fb53a5ee911b6e6.tar.bz2
manaplus-d94f088b0f81fb114980830d8fb53a5ee911b6e6.tar.xz
manaplus-d94f088b0f81fb114980830d8fb53a5ee911b6e6.zip
Do mouse actions on emoteshortcutcontainer only if left mouse button was used.
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/emoteshortcutcontainer.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp
index 6df0cd398..7d15ba4a2 100644
--- a/src/gui/widgets/emoteshortcutcontainer.cpp
+++ b/src/gui/widgets/emoteshortcutcontainer.cpp
@@ -192,24 +192,27 @@ void EmoteShortcutContainer::mouseDragged(MouseEvent &restrict event A_UNUSED)
void EmoteShortcutContainer::mousePressed(MouseEvent &restrict event) restrict2
{
- if (!emoteShortcut)
- return;
+ if (event.getButton() == MouseButton::LEFT)
+ {
+ if (!emoteShortcut)
+ return;
- const int index = getIndexFromGrid(event.getX(), event.getY());
+ const int index = getIndexFromGrid(event.getX(), event.getY());
- if (index == -1)
- return;
+ if (index == -1)
+ return;
- event.consume();
- // Stores the selected emote if there is one.
- if (emoteShortcut->isEmoteSelected())
- {
- emoteShortcut->setEmote(index);
- emoteShortcut->setEmoteSelected(0);
- }
- else if (emoteShortcut->getEmote(index))
- {
- mEmoteClicked = true;
+ event.consume();
+ // Stores the selected emote if there is one.
+ if (emoteShortcut->isEmoteSelected())
+ {
+ emoteShortcut->setEmote(index);
+ emoteShortcut->setEmoteSelected(0);
+ }
+ else if (emoteShortcut->getEmote(index))
+ {
+ mEmoteClicked = true;
+ }
}
}