summaryrefslogtreecommitdiff
path: root/src/gui/updatewindow.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-06 17:24:00 -0700
committerIra Rice <irarice@gmail.com>2009-01-06 17:24:00 -0700
commit6f954aa5ed76baabf45248a91fa378552be425c0 (patch)
treea0a3fc6e8aec2524863a53bc95fdadb1c1d04dab /src/gui/updatewindow.cpp
parent83f00d36e4f768893f0f0c8ae6ee5de50fce17d8 (diff)
downloadmana-6f954aa5ed76baabf45248a91fa378552be425c0.tar.gz
mana-6f954aa5ed76baabf45248a91fa378552be425c0.tar.bz2
mana-6f954aa5ed76baabf45248a91fa378552be425c0.tar.xz
mana-6f954aa5ed76baabf45248a91fa378552be425c0.zip
Adapted the update window to use the layout widget.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/updatewindow.cpp')
-rw-r--r--src/gui/updatewindow.cpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp
index 36d00bec..e0a9da2e 100644
--- a/src/gui/updatewindow.cpp
+++ b/src/gui/updatewindow.cpp
@@ -32,6 +32,8 @@
#include "scrollarea.h"
#include "updatewindow.h"
+#include "widgets/layout.h"
+
// Curl should be included after Guichan to avoid Windows redefinitions
#include <curl/curl.h>
@@ -105,34 +107,29 @@ UpdaterWindow::UpdaterWindow(const std::string &updateHost,
{
mCurlError[0] = 0;
- const int h = 240;
- const int w = 320;
- setContentSize(w, h);
-
mBrowserBox = new BrowserBox();
mScrollArea = new ScrollArea(mBrowserBox);
mLabel = new gcn::Label("Connecting...");
- mProgressBar = new ProgressBar(0.0, w - 10, 20, 168, 116, 31);
+ mProgressBar = new ProgressBar(0.0, 310, 20, 168, 116, 31);
mCancelButton = new Button("Cancel", "cancel", this);
mPlayButton = new Button("Play", "play", this);
mBrowserBox->setOpaque(false);
mPlayButton->setEnabled(false);
- mCancelButton->setPosition(5, h - 5 - mCancelButton->getHeight());
- mPlayButton->setPosition(
- mCancelButton->getX() + mCancelButton->getWidth() + 5,
- h - 5 - mPlayButton->getHeight());
- mProgressBar->setPosition(5, mCancelButton->getY() - 20 - 5);
- mLabel->setPosition(5, mProgressBar->getY() - mLabel->getHeight() - 5);
+ ContainerPlacer place;
+ place = getPlacer(0, 0);
+
+ place(0, 0, mScrollArea, 5, 3).setPadding(3);
+ place(0, 3, mLabel, 5);
+ place(0, 4, mProgressBar, 5);
+ place(0, 5, mCancelButton);
+ place(1, 5, mPlayButton);
- mScrollArea->setDimension(gcn::Rectangle(5, 5, 310, mLabel->getY() - 12));
+ reflowLayout(320, 240);
- add(mScrollArea);
- add(mLabel);
- add(mProgressBar);
- add(mCancelButton);
- add(mPlayButton);
+ Layout &layout = getLayout();
+ layout.setRowHeight(0, Layout::AUTO_SET);
setLocationRelativeTo(getParent());
setVisible(true);