summaryrefslogtreecommitdiff
path: root/src/gui/widgets/playerbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/playerbox.cpp')
-rw-r--r--src/gui/widgets/playerbox.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp
index 7ef543511..2ba452620 100644
--- a/src/gui/widgets/playerbox.cpp
+++ b/src/gui/widgets/playerbox.cpp
@@ -36,7 +36,8 @@ PlayerBox::PlayerBox(Widget2 *const widget,
Being *const being,
const std::string &skin,
const std::string &selectedSkin) :
- ScrollArea(widget),
+ Widget(widget),
+ MouseListener(),
mBeing(being),
mAlpha(1.0),
mBackground(),
@@ -54,7 +55,8 @@ PlayerBox::PlayerBox(Widget2 *const widget,
PlayerBox::PlayerBox(Widget2 *const widget,
const std::string &skin,
const std::string &selectedSkin) :
- ScrollArea(widget),
+ Widget(widget),
+ MouseListener(),
mBeing(nullptr),
mAlpha(1.0),
mBackground(),
@@ -82,6 +84,7 @@ PlayerBox::~PlayerBox()
void PlayerBox::init(std::string name, std::string selectedName)
{
setFrameSize(2);
+ addMouseListener(this);
Theme *const theme = Theme::instance();
if (theme)
@@ -153,10 +156,10 @@ void PlayerBox::drawFrame(Graphics *graphics)
void PlayerBox::mouseReleased(MouseEvent& event)
{
- ScrollArea::mouseReleased(event);
if (event.getButton() == MouseEvent::LEFT)
{
if (!mActionEventId.empty())
distributeActionEvent();
+ event.consume();
}
}