summaryrefslogtreecommitdiff
path: root/src/gui/confirm_dialog.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-04-20 20:32:12 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-20 20:32:55 +0200
commitb926bec4ff23e43729e88ea36c3cba9509b66f7c (patch)
treea68850498d170640f57e2d0f74716b6a61f700c9 /src/gui/confirm_dialog.cpp
parenta1dbbdf1ca8560de8cff703d21c0063610261196 (diff)
downloadmana-client-b926bec4ff23e43729e88ea36c3cba9509b66f7c.tar.gz
mana-client-b926bec4ff23e43729e88ea36c3cba9509b66f7c.tar.bz2
mana-client-b926bec4ff23e43729e88ea36c3cba9509b66f7c.tar.xz
mana-client-b926bec4ff23e43729e88ea36c3cba9509b66f7c.zip
Reduced the weight of a few gui windows and popups which wrapped their
TextBoxes in ScrollAreas, but never needed to scroll (and disabled both the horizontal and vertical scrollbars, which makes using a scrollarea kind of pointless to begin with). Signed-off-by: Ira Rice <irarice@gmail.com> Signed-off-by: Bjørn Lindeijer <bjorn@lindeijer.nl>
Diffstat (limited to 'src/gui/confirm_dialog.cpp')
-rw-r--r--src/gui/confirm_dialog.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/gui/confirm_dialog.cpp b/src/gui/confirm_dialog.cpp
index 969000f3..7caa4580 100644
--- a/src/gui/confirm_dialog.cpp
+++ b/src/gui/confirm_dialog.cpp
@@ -22,7 +22,6 @@
#include "gui/confirm_dialog.h"
#include "gui/widgets/button.h"
-#include "gui/widgets/scrollarea.h"
#include "gui/widgets/textbox.h"
#include "gui/gui.h"
@@ -38,17 +37,11 @@ ConfirmDialog::ConfirmDialog(const std::string &title, const std::string &msg,
mTextBox = new TextBox;
mTextBox->setEditable(false);
mTextBox->setOpaque(false);
+ mTextBox->setTextWrapped(msg, 260);
- mTextArea = new ScrollArea(mTextBox);
gcn::Button *yesButton = new Button(_("Yes"), "yes", this);
gcn::Button *noButton = new Button(_("No"), "no", this);
- mTextArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
- mTextArea->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
- mTextArea->setOpaque(false);
-
- mTextBox->setTextWrapped(msg, 260);
-
const int numRows = mTextBox->getNumberOfRows();
const int inWidth = yesButton->getWidth() + noButton->getWidth() +
(2 * getPadding());
@@ -63,8 +56,7 @@ ConfirmDialog::ConfirmDialog(const std::string &title, const std::string &msg,
setContentSize(mTextBox->getMinWidth() + fontHeight, height + fontHeight +
noButton->getHeight());
- mTextArea->setDimension(gcn::Rectangle(4, 5, width + 2 * getPadding(),
- height + getPadding()));
+ mTextBox->setPosition(getPadding(), getPadding());
// 8 is the padding that GUIChan adds to button widgets
// (top and bottom combined)
@@ -72,7 +64,7 @@ ConfirmDialog::ConfirmDialog(const std::string &title, const std::string &msg,
noButton->setPosition(yesButton->getX() + inWidth - noButton->getWidth(),
height + 8);
- add(mTextArea);
+ add(mTextBox);
add(yesButton);
add(noButton);