From 2cf71ffbfda49bc3791490f4d035897bb35298f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Mon, 2 Jan 2017 13:24:25 +0100 Subject: 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. --- plugingui/button.cc | 5 +++++ plugingui/checkbox.cc | 5 +++++ plugingui/combobox.cc | 5 +++++ plugingui/knob.cc | 5 +++++ plugingui/lineedit.cc | 5 +++++ plugingui/listboxbasic.cc | 5 +++++ plugingui/scrollbar.cc | 5 +++++ plugingui/slider.cc | 5 +++++ 8 files changed, 40 insertions(+) (limited to 'plugingui') 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; -- cgit v1.2.3