From d94f088b0f81fb114980830d8fb53a5ee911b6e6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 9 May 2016 23:58:34 +0300 Subject: Do mouse actions on emoteshortcutcontainer only if left mouse button was used. --- src/gui/widgets/emoteshortcutcontainer.cpp | 33 ++++++++++++++++-------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'src/gui/widgets/emoteshortcutcontainer.cpp') 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; + } } } -- cgit v1.2.3-60-g2f50