From b926bec4ff23e43729e88ea36c3cba9509b66f7c Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 20 Apr 2009 20:32:12 +0200 Subject: 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). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ira Rice Signed-off-by: Bjørn Lindeijer --- src/gui/confirm_dialog.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/gui/confirm_dialog.cpp') 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); -- cgit v1.2.3-70-g09d2