diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-10-05 12:45:41 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-10-05 12:45:41 +0300 |
commit | 01660865a49250c6ed77159cb3d8b38e7ea37b95 (patch) | |
tree | d08d552b885ac4e735d778200963f9f64190e37b | |
parent | 901898455259123e13a32a35052b4cadfa8c8a30 (diff) | |
download | plus-01660865a49250c6ed77159cb3d8b38e7ea37b95.tar.gz plus-01660865a49250c6ed77159cb3d8b38e7ea37b95.tar.bz2 plus-01660865a49250c6ed77159cb3d8b38e7ea37b95.tar.xz plus-01660865a49250c6ed77159cb3d8b38e7ea37b95.zip |
Run click action in list box only after mouse released.
Before was on mouse pressed.
-rw-r--r-- | src/gui/widgets/avatarlistbox.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/avatarlistbox.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/listbox.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/listbox.h | 4 | ||||
-rw-r--r-- | src/gui/widgets/popuplist.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/popuplist.h | 2 |
6 files changed, 14 insertions, 8 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 76b5ccfc4..eb1a00fe2 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -419,6 +419,10 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) } } +void AvatarListBox::mouseReleased(gcn::MouseEvent &event A_UNUSED) +{ +} + void AvatarListBox::optionChanged(const std::string &value) { if (value == "showgender") diff --git a/src/gui/widgets/avatarlistbox.h b/src/gui/widgets/avatarlistbox.h index 5d7d5c3ac..8760fab73 100644 --- a/src/gui/widgets/avatarlistbox.h +++ b/src/gui/widgets/avatarlistbox.h @@ -57,6 +57,8 @@ public: void mousePressed(gcn::MouseEvent &event) override; + void mouseReleased(gcn::MouseEvent &event A_UNUSED) override; + void optionChanged(const std::string &value) override; private: diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 4dd1da8d9..8d945180a 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -204,11 +204,11 @@ void ListBox::mouseWheelMovedDown(gcn::MouseEvent &mouseEvent A_UNUSED) { } -void ListBox::mousePressed(gcn::MouseEvent &event) +void ListBox::mouseReleased(gcn::MouseEvent &event) { if (mDistributeMousePressed) { - mousePressed1(event); + mouseReleased1(event); } else { @@ -222,7 +222,7 @@ void ListBox::mousePressed(gcn::MouseEvent &event) if (gui) gui->resetClickCount(); if (mOldSelected == mSelected) - mousePressed1(event); + mouseReleased1(event); else mouseDragged(event); mOldSelected = mSelected; @@ -235,7 +235,7 @@ void ListBox::mousePressed(gcn::MouseEvent &event) } } -void ListBox::mousePressed1(gcn::MouseEvent &mouseEvent) +void ListBox::mouseReleased1(gcn::MouseEvent &mouseEvent) { if (mouseEvent.getButton() == gcn::MouseEvent::LEFT) { diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h index 909159e11..4397a201e 100644 --- a/src/gui/widgets/listbox.h +++ b/src/gui/widgets/listbox.h @@ -73,9 +73,9 @@ class ListBox : public gcn::ListBox, void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override; - void mousePressed(gcn::MouseEvent &event) override; + void mouseReleased(gcn::MouseEvent &event) override; - void mousePressed1(gcn::MouseEvent &event); + void mouseReleased1(gcn::MouseEvent &event); void mouseDragged(gcn::MouseEvent &event) override; diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp index 3b382f38a..2d32a5490 100644 --- a/src/gui/widgets/popuplist.cpp +++ b/src/gui/widgets/popuplist.cpp @@ -122,7 +122,7 @@ void PopupList::adjustSize() mListBox->setWidth(width); } -void PopupList::mousePressed(gcn::MouseEvent& mouseEvent) +void PopupList::mouseReleased(gcn::MouseEvent& mouseEvent) { if (mouseEvent.getSource() == mScrollArea) return; diff --git a/src/gui/widgets/popuplist.h b/src/gui/widgets/popuplist.h index 1ffb2d74c..ad2ad0d03 100644 --- a/src/gui/widgets/popuplist.h +++ b/src/gui/widgets/popuplist.h @@ -63,7 +63,7 @@ class PopupList final : public Popup, void focusLost(const gcn::Event& event A_UNUSED) override; - void mousePressed(gcn::MouseEvent& mouseEvent) override; + void mouseReleased(gcn::MouseEvent& mouseEvent) override; private: gcn::ListModel *mListModel; |