Fixed visual issues as per @delvh 's request
This commit is contained in:
		@@ -91,7 +91,7 @@ public class Client implements Closeable {
 | 
			
		||||
		SerializationUtils.writeBytesWithLength(credentials, socket.getOutputStream());
 | 
			
		||||
 | 
			
		||||
		// Wait for a maximum of five seconds to acquire the sender object
 | 
			
		||||
		long start = System.currentTimeMillis();
 | 
			
		||||
		final long start = System.currentTimeMillis();
 | 
			
		||||
		while (sender == null) {
 | 
			
		||||
 | 
			
		||||
			// Quit immediately after handshake rejection
 | 
			
		||||
@@ -162,7 +162,7 @@ public class Client implements Closeable {
 | 
			
		||||
		eventBus.register(SendEvent.class, evt -> {
 | 
			
		||||
			try {
 | 
			
		||||
				sendEvent(evt.get());
 | 
			
		||||
			} catch (IOException e) {
 | 
			
		||||
			} catch (final IOException e) {
 | 
			
		||||
				e.printStackTrace();
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
@@ -221,7 +221,7 @@ public class Client implements Closeable {
 | 
			
		||||
	 */
 | 
			
		||||
	public Map<String, Contact> getUsers() {
 | 
			
		||||
		checkOnline();
 | 
			
		||||
		Map<String, Contact> users = new HashMap<>();
 | 
			
		||||
		final Map<String, Contact> users = new HashMap<>();
 | 
			
		||||
		contacts.forEach(u -> users.put(u.getName(), u));
 | 
			
		||||
		users.put(sender.getName(), sender);
 | 
			
		||||
		return users;
 | 
			
		||||
 
 | 
			
		||||
@@ -232,9 +232,6 @@ public final class ChatScene {
 | 
			
		||||
	 */
 | 
			
		||||
	@FXML
 | 
			
		||||
	private void checkKeyCombination(KeyEvent e) {
 | 
			
		||||
		// TODO: Letting go of ctrl automatically posts a message. Needs to be fixed
 | 
			
		||||
		// soon.
 | 
			
		||||
 | 
			
		||||
		// Automatic sending of messages via (ctrl +) enter
 | 
			
		||||
		if (!postButton.isDisabled() && settings.isEnterToSend() && e.getCode() == KeyCode.ENTER
 | 
			
		||||
				|| !settings.isEnterToSend() && e.getCode() == KeyCode.ENTER && e.isControlDown())
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@ import envoy.util.EnvoyLog;
 | 
			
		||||
 * Project: <strong>envoy-client</strong><br>
 | 
			
		||||
 * File: <strong>LoginDialog.java</strong><br>
 | 
			
		||||
 * Created: <strong>03.04.2020</strong><br>
 | 
			
		||||
 * 
 | 
			
		||||
 *
 | 
			
		||||
 * @author Kai S. K. Engelbart
 | 
			
		||||
 * @since Envoy Client v0.1-beta
 | 
			
		||||
 */
 | 
			
		||||
@@ -72,7 +72,7 @@ public final class LoginScene {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Loads the login dialog using the FXML file {@code LoginDialog.fxml}.
 | 
			
		||||
	 * 
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param client               the client used to perform the handshake
 | 
			
		||||
	 * @param localDB              the local database used for offline login
 | 
			
		||||
	 * @param receivedMessageCache the cache storing messages received during
 | 
			
		||||
@@ -104,9 +104,7 @@ public final class LoginScene {
 | 
			
		||||
		if (registerCheckBox.isSelected() && !passwordField.getText().equals(repeatPasswordField.getText())) {
 | 
			
		||||
			clearPasswordFields();
 | 
			
		||||
			new Alert(AlertType.ERROR, "The entered password is unequal to the repeated one").showAndWait();
 | 
			
		||||
		} else {
 | 
			
		||||
			performHandshake(new LoginCredentials(userTextField.getText(), passwordField.getText().toCharArray(), registerCheckBox.isSelected()));
 | 
			
		||||
		}
 | 
			
		||||
		} else performHandshake(new LoginCredentials(userTextField.getText(), passwordField.getText().toCharArray(), registerCheckBox.isSelected()));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@FXML
 | 
			
		||||
@@ -120,7 +118,6 @@ public final class LoginScene {
 | 
			
		||||
		// Make repeat password field and label visible / invisible
 | 
			
		||||
		repeatPasswordField.setVisible(registerCheckBox.isSelected());
 | 
			
		||||
		repeatPasswordLabel.setVisible(registerCheckBox.isSelected());
 | 
			
		||||
 | 
			
		||||
		clearPasswordFields();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -148,12 +145,12 @@ public final class LoginScene {
 | 
			
		||||
		try {
 | 
			
		||||
			// Try entering offline mode
 | 
			
		||||
			localDB.loadUsers();
 | 
			
		||||
			User clientUser = (User) localDB.getUsers().get(credentials.getIdentifier());
 | 
			
		||||
			final User clientUser = (User) localDB.getUsers().get(credentials.getIdentifier());
 | 
			
		||||
			if (clientUser == null) throw new EnvoyException("Could not enter offline mode: user name unknown");
 | 
			
		||||
			client.setSender(clientUser);
 | 
			
		||||
			new Alert(AlertType.WARNING, "A connection to the server could not be established. Starting in offline mode.").showAndWait();
 | 
			
		||||
			loadChatScene();
 | 
			
		||||
		} catch (Exception e) {
 | 
			
		||||
		} catch (final Exception e) {
 | 
			
		||||
			new Alert(AlertType.ERROR, "Client error: " + e).showAndWait();
 | 
			
		||||
			System.exit(1);
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -4,8 +4,8 @@
 | 
			
		||||
 * Project: <strong>envoy-client</strong><br>
 | 
			
		||||
 * File: <strong>package-info.java</strong><br>
 | 
			
		||||
 * Created: <strong>08.06.2020</strong><br>
 | 
			
		||||
 * 
 | 
			
		||||
 *
 | 
			
		||||
 * @author Kai S. K. Engelbart
 | 
			
		||||
 * @since Envoy Client v0.1-beta
 | 
			
		||||
 */
 | 
			
		||||
package envoy.client.ui.controller;
 | 
			
		||||
package envoy.client.ui.controller;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
.button{
 | 
			
		||||
	-fx-background-color: rgb(105,0,153);
 | 
			
		||||
	-fx-text-fill: white;
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,3 @@
 | 
			
		||||
.button{
 | 
			
		||||
	-fx-background-color: snow;
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user