| 1 | ServerSettings* serverSettings = nullptr; |
| 2 | |
| 3 | ServerSettings::ServerSettings() { |
| 4 | hostLabel.setText("Hostname:"); |
| 5 | userLabel.setText("Username:"); |
| 6 | passLabel.setText("Password:"); |
| 7 | |
| 8 | unsigned width = min( |
| 9 | Font::size(program->normalFont, "Hostname:").width, |
| 10 | Font::size(program->normalFont, "Username:").width |
| 11 | ); |
| 12 | |
| 13 | append(hostLayout, {~0, 0}, 5); |
| 14 | hostLayout.append(hostLabel, {width, 0}, 5); |
| 15 | hostLayout.append(hostEdit, {~0, 0}); |
| 16 | append(userLayout, {~0, 0}); |
| 17 | userLayout.append(userLabel, {width, 0}, 5); |
| 18 | userLayout.append(userEdit, {~0, 0}, 5); |
| 19 | userLayout.append(passLabel, {0, 0}, 5); |
| 20 | userLayout.append(passEdit, {~0, 0}); |
| 21 | |
| 22 | hostEdit.setText(config->server.hostname); |
| 23 | userEdit.setText(config->server.username); |
| 24 | passEdit.setText(config->server.password); |
| 25 | |
| 26 | hostEdit.onChange = [&] { config->server.hostname = hostEdit.text(); }; |
| 27 | userEdit.onChange = [&] { config->server.username = userEdit.text(); }; |
| 28 | passEdit.onChange = [&] { config->server.password = passEdit.text(); }; |
| 29 | } |