summaryrefslogtreecommitdiff
path: root/src/gui/ok_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/ok_dialog.cpp
parenta1dbbdf1ca8560de8cff703d21c0063610261196 (diff)
downloadmana-b926bec4ff23e43729e88ea36c3cba9509b66f7c.tar.gz
mana-b926bec4ff23e43729e88ea36c3cba9509b66f7c.tar.bz2
mana-b926bec4ff23e43729e88ea36c3cba9509b66f7c.tar.xz
mana-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/ok_dialog.cpp')
-rw-r--r--src/gui/ok_dialog.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/gui/ok_dialog.cpp b/src/gui/ok_dialog.cpp
index 7ccb781e..fc8c81db 100644
--- a/src/gui/ok_dialog.cpp
+++ b/src/gui/ok_dialog.cpp
@@ -24,7 +24,6 @@
#include "gui/gui.h"
#include "gui/widgets/button.h"
-#include "gui/widgets/scrollarea.h"
#include "gui/widgets/textbox.h"
#include "utils/gettext.h"
@@ -38,16 +37,10 @@ OkDialog::OkDialog(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 *okButton = new Button(_("Ok"), "ok", 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 fontHeight = getFont()->getHeight();
const int height = numRows * fontHeight;
@@ -60,14 +53,13 @@ OkDialog::OkDialog(const std::string &title, const std::string &msg,
setContentSize(mTextBox->getMinWidth() + fontHeight, height +
fontHeight + okButton->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)
okButton->setPosition((width - okButton->getWidth()) / 2, height + 8);
- add(mTextArea);
+ add(mTextBox);
add(okButton);
center();