summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/npclistdialog.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/gui/npclistdialog.cpp b/src/gui/npclistdialog.cpp
index 34b5ab41..e18b2ae8 100644
--- a/src/gui/npclistdialog.cpp
+++ b/src/gui/npclistdialog.cpp
@@ -24,6 +24,8 @@
#include "listbox.h"
#include "npclistdialog.h"
+#include "widgets/layout.h"
+
#include "../npc.h"
#include "../utils/gettext.h"
@@ -43,23 +45,15 @@ NpcListDialog::NpcListDialog():
setContentSize(260, 175);
scrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
- scrollArea->setDimension(gcn::Rectangle(
- 5, 5, 250, 160 - okButton->getHeight()));
- cancelButton->setPosition(
- 260 - 5 - cancelButton->getWidth(),
- 175 - 5 - cancelButton->getHeight());
- okButton->setPosition(
- cancelButton->getX() - 5 - okButton->getWidth(),
- cancelButton->getY());
-
- mItemList->setActionEventId("item");
- mItemList->addActionListener(this);
+ place(0, 0, scrollArea, 5).setPadding(3);
+ place(3, 1, cancelButton);
+ place(4, 1, okButton);
- add(scrollArea);
- add(okButton);
- add(cancelButton);
+ Layout &layout = getLayout();
+ layout.setRowHeight(0, Layout::AUTO_SET);
+ loadWindowState();
setLocationRelativeTo(getParent());
}