diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-20 13:38:56 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-20 13:38:56 -0700 |
commit | babcce6724a0abfe1e98be55ca49124a3459bd87 (patch) | |
tree | f3d1533a8f264a71128a987d894644d0bbb2e7f4 /src/gui | |
parent | 30ff433fe1546a61a2ccff2fd53cadc843a75476 (diff) | |
download | mana-babcce6724a0abfe1e98be55ca49124a3459bd87.tar.gz mana-babcce6724a0abfe1e98be55ca49124a3459bd87.tar.bz2 mana-babcce6724a0abfe1e98be55ca49124a3459bd87.tar.xz mana-babcce6724a0abfe1e98be55ca49124a3459bd87.zip |
Reflowed the NPC list dialog to use the layout code.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/npclistdialog.cpp | 22 |
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()); } |