From 76ec7d66c0bb691f3409beb2448718a0bcefcc50 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Thu, 2 Sep 2010 21:17:08 +0200 Subject: Fixing escape key in charselectdialog * In charselectdialog the requestFocus is now called later, because before it had no effect, since it was called before the characters were present. Having no char with focus has the side effect that the escape key gets ignored. * Removing the code for variable width of CharacterDisplay, because with recent changes it is executed before the characters are present, therefore it had no effect. --- src/gui/charselectdialog.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp index e22c4daf..f8c28c6a 100644 --- a/src/gui/charselectdialog.cpp +++ b/src/gui/charselectdialog.cpp @@ -164,10 +164,10 @@ CharSelectDialog::CharSelectDialog(LoginData *loginData): addKeyListener(this); center(); - mCharacterEntries[0]->requestFocus(); setVisible(true); Net::getCharHandler()->setCharSelectDialog(this); + mCharacterEntries[0]->requestFocus(); } CharSelectDialog::~CharSelectDialog() @@ -328,10 +328,10 @@ CharacterDisplay::CharacterDisplay(CharSelectDialog *charSelectDialog): mCharacter(0), mPlayerBox(new PlayerBox) { - mButton = new Button("wwwwwwwww", "go", charSelectDialog); - mName = new Label("wwwwwwwwwwwwwwwwwwwwwwww"); - mLevel = new Label("(888)"); - mMoney = new Label("wwwwwwwww"); + mButton = new Button("", "go", charSelectDialog); + mName = new Label(""); + mLevel = new Label(""); + mMoney = new Label(""); mDelete = new Button(_("Delete"), "delete", charSelectDialog); @@ -347,15 +347,7 @@ CharacterDisplay::CharacterDisplay(CharSelectDialog *charSelectDialog): update(); - // Setting the width so that the largest label fits. - mName->adjustSize(); - mMoney->adjustSize(); - int width = 74; - if (width < 20 + mName->getWidth()) - width = 20 + mName->getWidth(); - if (width < 20 + mMoney->getWidth()) - width = 20 + mMoney->getWidth(); - h.reflowLayout(width, 112 + mName->getHeight() + mLevel->getHeight() + + h.reflowLayout(80, 112 + mName->getHeight() + mLevel->getHeight() + mMoney->getHeight() + mButton->getHeight() + mDelete->getHeight()); } -- cgit v1.2.3-70-g09d2