Skip to content

Commit 5741811

Browse files
authoredFeb 23, 2018
Registration dialog: Larger text field with scrollbars (#7047)
Center text, text area doubled now
1 parent 673f719 commit 5741811

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed
 

Diff for: ‎src/gui/guiConfirmRegistration.cpp

+14-7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2020

2121
#include "guiConfirmRegistration.h"
2222
#include "client.h"
23+
#include "intlGUIEditBox.h"
2324
#include <IGUICheckBox.h>
2425
#include <IGUIEditBox.h>
2526
#include <IGUIButton.h>
@@ -66,8 +67,8 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
6667
/*
6768
Calculate new sizes and positions
6869
*/
69-
core::rect<s32> rect(screensize.X / 2 - 600 / 2, screensize.Y / 2 - 300 / 2,
70-
screensize.X / 2 + 600 / 2, screensize.Y / 2 + 300 / 2);
70+
core::rect<s32> rect(screensize.X / 2 - 600 / 2, screensize.Y / 2 - 360 / 2,
71+
screensize.X / 2 + 600 / 2, screensize.Y / 2 + 360 / 2);
7172

7273
DesiredRect = rect;
7374
recalculateAbsolutePosition(false);
@@ -85,7 +86,7 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
8586
std::string address = m_address;
8687
if (address.empty())
8788
address = "localhost";
88-
core::rect<s32> rect(0, 0, 540, 90);
89+
core::rect<s32> rect(0, 0, 540, 180);
8990
rect += topleft_client + v2s32(30, ypos);
9091
static const std::string info_text_template = strgettext(
9192
"You are about to join the server at %1$s with the "
@@ -98,11 +99,17 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
9899
char info_text_buf[1024];
99100
snprintf(info_text_buf, sizeof(info_text_buf), info_text_template.c_str(),
100101
address.c_str(), m_playername.c_str());
101-
Environment->addStaticText(narrow_to_wide_c(info_text_buf), rect, false,
102-
true, this, -1);
102+
103+
gui::intlGUIEditBox *e = new gui::intlGUIEditBox(
104+
utf8_to_wide_c(info_text_buf), true, Environment, this,
105+
ID_message, rect, false, true);
106+
e->drop();
107+
e->setMultiLine(true);
108+
e->setWordWrap(true);
109+
e->setTextAlignment(gui::EGUIA_UPPERLEFT, gui::EGUIA_CENTER);
103110
}
104111

105-
ypos += 120;
112+
ypos += 210;
106113
{
107114
core::rect<s32> rect(0, 0, 540, 30);
108115
rect += topleft_client + v2s32(30, ypos);
@@ -111,7 +118,7 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
111118
e->setPasswordBox(true);
112119
}
113120

114-
ypos += 90;
121+
ypos += 60;
115122
{
116123
core::rect<s32> rect(0, 0, 230, 35);
117124
rect = rect + v2s32(size.X / 2 - 220, ypos);

0 commit comments

Comments
 (0)