summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-03 14:59:29 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-03 14:59:29 +0300
commitf555fdf0d99622ac0d52881ebf126377287f1d3e (patch)
treeec3648afe7a084488c78c6b61c425333aba7bc34 /src
parent56b3195a88c660ced1c19de77e13db1f630c5ecd (diff)
downloadmanaverse-f555fdf0d99622ac0d52881ebf126377287f1d3e.tar.gz
manaverse-f555fdf0d99622ac0d52881ebf126377287f1d3e.tar.bz2
manaverse-f555fdf0d99622ac0d52881ebf126377287f1d3e.tar.xz
manaverse-f555fdf0d99622ac0d52881ebf126377287f1d3e.zip
remove scrollarea from playerbox base classes.
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:
/**