summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2017-01-02 13:24:25 +0100
committerAndré Nusser <andre.nusser@googlemail.com>2017-01-02 13:24:25 +0100
commit2cf71ffbfda49bc3791490f4d035897bb35298f8 (patch)
tree1ed15f0d94f3e10f1b379d51f49f4528cc9df7c6
parent7baaa737216080d7ddbeb7d92e53f6078dfd4d3a (diff)
Ignore all clicks except left clicks in all the widgets.
Of course, we want to change this as soon as we actually want to use right and middle clicks. But this is not the case atm.
-rw-r--r--plugingui/button.cc5
-rw-r--r--plugingui/checkbox.cc5
-rw-r--r--plugingui/combobox.cc5
-rw-r--r--plugingui/knob.cc5
-rw-r--r--plugingui/lineedit.cc5
-rw-r--r--plugingui/listboxbasic.cc5
-rw-r--r--plugingui/scrollbar.cc5
-rw-r--r--plugingui/slider.cc5
8 files changed, 40 insertions, 0 deletions
diff --git a/plugingui/button.cc b/plugingui/button.cc
index 5270658..7c1e005 100644
--- a/plugingui/button.cc
+++ b/plugingui/button.cc
@@ -46,6 +46,11 @@ Button::~Button()
void Button::buttonEvent(ButtonEvent* buttonEvent)
{
+ // Ignore everything except left clicks.
+ if (buttonEvent->button != MouseButton::left) {
+ return;
+ }
+
if(buttonEvent->direction == Direction::down)
{
draw_state = down;
diff --git a/plugingui/checkbox.cc b/plugingui/checkbox.cc
index a218d44..4f71e54 100644
--- a/plugingui/checkbox.cc
+++ b/plugingui/checkbox.cc
@@ -41,6 +41,11 @@ CheckBox::CheckBox(Widget* parent)
void CheckBox::buttonEvent(ButtonEvent* buttonEvent)
{
+ // Ignore everything except left clicks.
+ if (buttonEvent->button != MouseButton::left) {
+ return;
+ }
+
if((buttonEvent->direction == Direction::up) || buttonEvent->doubleClick)
{
buttonDown = false;
diff --git a/plugingui/combobox.cc b/plugingui/combobox.cc
index 752dbb3..5b7dd89 100644
--- a/plugingui/combobox.cc
+++ b/plugingui/combobox.cc
@@ -209,6 +209,11 @@ void ComboBox::keyEvent(KeyEvent* keyEvent)
void ComboBox::buttonEvent(ButtonEvent* buttonEvent)
{
+ // Ignore everything except left clicks.
+ if (buttonEvent->button != MouseButton::left) {
+ return;
+ }
+
if(buttonEvent->direction != Direction::down)
{
return;
diff --git a/plugingui/knob.cc b/plugingui/knob.cc
index 27d4083..4e7db3b 100644
--- a/plugingui/knob.cc
+++ b/plugingui/knob.cc
@@ -124,6 +124,11 @@ void Knob::keyEvent(KeyEvent* keyEvent)
void Knob::buttonEvent(ButtonEvent* buttonEvent)
{
+ // Ignore everything except left clicks.
+ if (buttonEvent->button != MouseButton::left) {
+ return;
+ }
+
if(buttonEvent->direction == Direction::down)
{
state = down;
diff --git a/plugingui/lineedit.cc b/plugingui/lineedit.cc
index b99d103..50d4a39 100644
--- a/plugingui/lineedit.cc
+++ b/plugingui/lineedit.cc
@@ -77,6 +77,11 @@ void LineEdit::buttonEvent(ButtonEvent *buttonEvent)
return;
}
+ // Ignore everything except left clicks.
+ if (buttonEvent->button != MouseButton::left) {
+ return;
+ }
+
if(buttonEvent->direction == Direction::down)
{
for(int i = 0; i < (int)visibleText.length(); ++i)
diff --git a/plugingui/listboxbasic.cc b/plugingui/listboxbasic.cc
index d589ebb..3711b56 100644
--- a/plugingui/listboxbasic.cc
+++ b/plugingui/listboxbasic.cc
@@ -282,6 +282,11 @@ void ListBoxBasic::keyEvent(KeyEvent* keyEvent)
void ListBoxBasic::buttonEvent(ButtonEvent* buttonEvent)
{
+ // Ignore everything except left clicks.
+ if (buttonEvent->button != MouseButton::left) {
+ return;
+ }
+
if((buttonEvent->x > ((int)width() - btn_size)) &&
(buttonEvent->y < ((int)width() - 1)))
{
diff --git a/plugingui/scrollbar.cc b/plugingui/scrollbar.cc
index da82105..3f53f03 100644
--- a/plugingui/scrollbar.cc
+++ b/plugingui/scrollbar.cc
@@ -175,6 +175,11 @@ void ScrollBar::mouseMoveEvent(MouseMoveEvent* mouseMoveEvent)
void ScrollBar::buttonEvent(ButtonEvent* buttonEvent)
{
+ // Ignore everything except left clicks.
+ if (buttonEvent->button != MouseButton::left) {
+ return;
+ }
+
if((buttonEvent->y < (int)width()) && buttonEvent->y > 0)
{
if(buttonEvent->direction == Direction::down)
diff --git a/plugingui/slider.cc b/plugingui/slider.cc
index 71dd0c5..64a4b3f 100644
--- a/plugingui/slider.cc
+++ b/plugingui/slider.cc
@@ -99,6 +99,11 @@ void Slider::repaintEvent(RepaintEvent* repaintEvent)
void Slider::buttonEvent(ButtonEvent* buttonEvent)
{
+ // Ignore everything except left clicks.
+ if (buttonEvent->button != MouseButton::left) {
+ return;
+ }
+
if(buttonEvent->direction == Direction::down)
{
state = State::down;