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/ok_dialog.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/gui/ok_dialog.cpp') 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(); -- cgit v1.2.3-70-g09d2