diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-11-22 19:26:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-11-22 19:26:02 +0300 |
commit | af026c1d1e1d574cfc403064a3c9f6b10288d55e (patch) | |
tree | 23e95f7ff3609b5cc4792043aba90f76b1f3835e /src/gui/widgets/skilllistbox.h | |
parent | 09e8d7ba7a5e29e4991b21056e358a7dcf0dd2df (diff) | |
download | manaverse-af026c1d1e1d574cfc403064a3c9f6b10288d55e.tar.gz manaverse-af026c1d1e1d574cfc403064a3c9f6b10288d55e.tar.bz2 manaverse-af026c1d1e1d574cfc403064a3c9f6b10288d55e.tar.xz manaverse-af026c1d1e1d574cfc403064a3c9f6b10288d55e.zip |
Add popup menu for left click on skill level.
Diffstat (limited to 'src/gui/widgets/skilllistbox.h')
-rw-r--r-- | src/gui/widgets/skilllistbox.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/widgets/skilllistbox.h b/src/gui/widgets/skilllistbox.h index 35d2998a9..fcfeebe62 100644 --- a/src/gui/widgets/skilllistbox.h +++ b/src/gui/widgets/skilllistbox.h @@ -34,6 +34,7 @@ #include "gui/models/skillmodel.h" +#include "gui/popups/popupmenu.h" #include "gui/popups/skillpopup.h" #include "utils/delete2.h" @@ -234,6 +235,18 @@ class SkillListBox final : public ListBox return; event.consume(); mSkillClicked = true; + if (event.getX() > + getWidth() - mPadding - skill->skillLevelWidth) + { + SkillModel *const model = static_cast<SkillModel*>( + mListModel); + if (model && + mSelected >= 0 && + model->getSkillAt(mSelected) == skill) + { + popupMenu->showSkillPopup(skill); + } + } } } |