summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/playerbox.cpp9
-rw-r--r--src/gui/widgets/playerbox.h7
2 files changed, 11 insertions, 5 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();
}
}
diff --git a/src/gui/widgets/playerbox.h b/src/gui/widgets/playerbox.h
index 7481dc9db..aae2eefe6 100644
--- a/src/gui/widgets/playerbox.h
+++ b/src/gui/widgets/playerbox.h
@@ -23,7 +23,9 @@
#ifndef GUI_WIDGETS_PLAYERBOX_H
#define GUI_WIDGETS_PLAYERBOX_H
-#include "gui/base/widgets/scrollarea.hpp"
+#include "gui/widgets/scrollarea.h"
+
+#include "listeners/mouselistener.h"
#include "localconsts.h"
@@ -35,7 +37,8 @@ class Skin;
*
* \ingroup GUI
*/
-class PlayerBox final : public gcn::ScrollArea
+class PlayerBox final : public Widget,
+ public MouseListener
{
public:
/**