summaryrefslogtreecommitdiff
path: root/src/gui/widgets/popuplist.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-15 23:52:30 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-16 00:28:38 +0300
commit661a14c66685de67ec560005c285267fe7098c62 (patch)
tree66a0cf5a2f07f9b1bf4f932577e2d47663b49a41 /src/gui/widgets/popuplist.cpp
parent54ff2f6fec70e66d7a8b4a96b28fa7d46f2304a3 (diff)
downloadmanaplus-661a14c66685de67ec560005c285267fe7098c62.tar.gz
manaplus-661a14c66685de67ec560005c285267fe7098c62.tar.bz2
manaplus-661a14c66685de67ec560005c285267fe7098c62.tar.xz
manaplus-661a14c66685de67ec560005c285267fe7098c62.zip
Fix a bit jewelry theme for drop down list.
Fix drop down position.
Diffstat (limited to 'src/gui/widgets/popuplist.cpp')
-rw-r--r--src/gui/widgets/popuplist.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp
index eb711ddeb..586dd5172 100644
--- a/src/gui/widgets/popuplist.cpp
+++ b/src/gui/widgets/popuplist.cpp
@@ -36,20 +36,22 @@ PopupList::PopupList(DropDown *const widget,
gcn::FocusListener(),
mListModel(listModel),
mListBox(new ListBox(widget, listModel)),
- mScrollArea(new ScrollArea),
+ mScrollArea(new ScrollArea(mListBox, false)),
mDropDown(widget)
{
setFocusable(true);
mListBox->setDistributeMousePressed(true);
mListBox->addSelectionListener(this);
- mScrollArea->setContent(mListBox);
+ mScrollArea->setPosition(mPadding, mPadding);
add(mScrollArea);
if (getParent())
getParent()->addFocusListener(this);
if (gui)
gui->addGlobalFocusListener(this);
+
+ adjustSize();
}
PopupList::~PopupList()
@@ -104,9 +106,11 @@ void PopupList::setListModel(gcn::ListModel *model)
void PopupList::adjustSize()
{
- mScrollArea->setWidth(getWidth() - 8);
- mScrollArea->setHeight(getHeight() - 8);
+ const int pad2 = 2 * mPadding;
+ mScrollArea->setWidth(getWidth() - pad2);
+ mScrollArea->setHeight(getHeight() - pad2);
mListBox->adjustSize();
+ mListBox->setWidth(getWidth() - pad2);
}
void PopupList::valueChanged(const gcn::SelectionEvent& event A_UNUSED)