summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/widgets/dropdown.cpp1
-rw-r--r--src/gui/widgets/popuplist.cpp8
-rw-r--r--src/gui/widgets/popuplist.h2
3 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index 99438a2ce..7c41bbacc 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -76,6 +76,7 @@ DropDown::DropDown(const Widget2 *const widget,
mPushed(false),
mIsDragged(false)
{
+ mPopup->postInit();
mFrameSize = 2;
mForegroundColor2 = getThemeColor(Theme::DROPDOWN_OUTLINE);
diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp
index 346539348..5fd1e90cd 100644
--- a/src/gui/widgets/popuplist.cpp
+++ b/src/gui/widgets/popuplist.cpp
@@ -48,6 +48,10 @@ PopupList::PopupList(DropDown *const widget,
mListBox->setDistributeMousePressed(true);
mScrollArea->setPosition(mPadding, mPadding);
+}
+
+void PopupList::postInit()
+{
add(mScrollArea);
if (gui)
@@ -60,8 +64,8 @@ PopupList::PopupList(DropDown *const widget,
PopupList::~PopupList()
{
- if (getParent())
- getParent()->removeFocusListener(this);
+ if (mParent)
+ mParent->removeFocusListener(this);
if (gui)
gui->removeGlobalFocusListener(this);
removeKeyListener(mDropDown);
diff --git a/src/gui/widgets/popuplist.h b/src/gui/widgets/popuplist.h
index b4575d51e..9d48ba0e7 100644
--- a/src/gui/widgets/popuplist.h
+++ b/src/gui/widgets/popuplist.h
@@ -44,6 +44,8 @@ class PopupList final : public Popup,
A_DELETE_COPY(PopupList)
+ void postInit() override;
+
void show(int x, int y);
void widgetResized(const gcn::Event &event) override;