From b26c271ec14593b91f342ca822c57e626112bf22 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Mon, 17 Feb 2020 22:39:07 +0100 Subject: [PATCH] clean the code a bit --- src/gui/HighScoresDialog.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gui/HighScoresDialog.cxx b/src/gui/HighScoresDialog.cxx index 3f5df155b..86b194ce2 100644 --- a/src/gui/HighScoresDialog.cxx +++ b/src/gui/HighScoresDialog.cxx @@ -51,21 +51,15 @@ HighScoresDialog::HighScoresDialog(OSystem& osystem, DialogContainer& parent, WidgetArray wid; VariantList items; - _w = std::min(max_w, 44 * fontWidth + HBORDER * 2); - _h = std::min(max_h, 400); - ypos = VBORDER + _th; xpos = HBORDER; - - //items.clear(); - StaticTextWidget* s = new StaticTextWidget(this, _font, xpos, ypos + 1, "Variation "); myVariationWidget = new PopUpWidget(this, _font, s->getRight(), ypos, _font.getStringWidth("256") - 4, lineHeight, items, "", 0, kVariationChanged); wid.push_back(myVariationWidget); - ypos += lineHeight + VGAP * 4; + ypos += lineHeight + VGAP * 2; int xposRank = HBORDER; int xposScore = xposRank + _font.getStringWidth("Rank") + 16; @@ -106,8 +100,12 @@ HighScoresDialog::HighScoresDialog(OSystem& osystem, DialogContainer& parent, myMD5Widget = new StaticTextWidget(this, ifont, xpos, ypos + 1, "MD5: 12345678901234567890123456789012"); + _h = myMD5Widget->getBottom() + VBORDER + (lineHeight + 4) + VBORDER; + _w = myDeleteButtons[0]->getRight() + HBORDER; + addDefaultsOKCancelBGroup(wid, _font, "Save", "Cancel", " Reset "); - addToFocusList(wid); } + addToFocusList(wid); +} // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HighScoresDialog::~HighScoresDialog()