From d425e370aeea834cac28b3d4b412538645330c86 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 17 Oct 2013 21:38:15 +0300 Subject: add postInit function into popup. use postInit in beingpopup. --- src/gui/popups/beingpopup.cpp | 12 ++++++++---- src/gui/popups/beingpopup.h | 2 ++ src/gui/viewport.cpp | 2 ++ src/gui/widgets/popup.h | 4 ++++ 4 files changed, 16 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gui/popups/beingpopup.cpp b/src/gui/popups/beingpopup.cpp index b7e5c91ee..d36fcd28d 100644 --- a/src/gui/popups/beingpopup.cpp +++ b/src/gui/popups/beingpopup.cpp @@ -65,6 +65,14 @@ BeingPopup::BeingPopup() : mBeingComment->setForegroundColorAll(getThemeColor(Theme::POPUP), getThemeColor(Theme::POPUP_OUTLINE)); +} + +BeingPopup::~BeingPopup() +{ +} + +void BeingPopup::postInit() +{ add(mBeingName); add(mBeingParty); add(mBeingGuild); @@ -72,10 +80,6 @@ BeingPopup::BeingPopup() : add(mBeingComment); } -BeingPopup::~BeingPopup() -{ -} - void BeingPopup::show(const int x, const int y, Being *const b) { if (!b) diff --git a/src/gui/popups/beingpopup.h b/src/gui/popups/beingpopup.h index 12ba49aa0..d91464ebe 100644 --- a/src/gui/popups/beingpopup.h +++ b/src/gui/popups/beingpopup.h @@ -50,6 +50,8 @@ class BeingPopup final : public Popup */ void show(const int x, const int y, Being *const b); + void postInit(); + #ifdef USE_PROFILER void logic(); #endif diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 958fd3587..4404060d5 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -78,6 +78,8 @@ Viewport::Viewport() : mCameraRelativeX(0), mCameraRelativeY(0) { + mBeingPopup->postInit(); + setOpaque(false); addMouseListener(this); diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h index 7c367586b..4f59978ce 100644 --- a/src/gui/widgets/popup.h +++ b/src/gui/widgets/popup.h @@ -170,6 +170,10 @@ class Popup : public Container, public gcn::MouseListener, bool isPopupVisible() const { return mVisible; } + virtual void postInit() + { + } + protected: int mPadding; /**< Holds the padding of the popup. */ Skin *mSkin; /**< Skin in use by this popup */ -- cgit v1.2.3-70-g09d2