diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-05-09 23:58:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-05-09 23:58:34 +0300 |
commit | d94f088b0f81fb114980830d8fb53a5ee911b6e6 (patch) | |
tree | f2590b2fc54d8fd3f35304cb54045647f34e9589 /src/gui/widgets/emoteshortcutcontainer.cpp | |
parent | e2104c4fffcf86287f4bc7efbed7b3a29839be76 (diff) | |
download | manaverse-d94f088b0f81fb114980830d8fb53a5ee911b6e6.tar.gz manaverse-d94f088b0f81fb114980830d8fb53a5ee911b6e6.tar.bz2 manaverse-d94f088b0f81fb114980830d8fb53a5ee911b6e6.tar.xz manaverse-d94f088b0f81fb114980830d8fb53a5ee911b6e6.zip |
Do mouse actions on emoteshortcutcontainer only if left mouse button was used.
Diffstat (limited to 'src/gui/widgets/emoteshortcutcontainer.cpp')
-rw-r--r-- | src/gui/widgets/emoteshortcutcontainer.cpp | 33 |
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; + } } } |