Merge pull request #149 from informatik-ag-ngl/f/visually_pleasing_experience
Improved general appearance of Envoy, both in FXML and CSS
This commit is contained in:
@ -3,7 +3,6 @@ package envoy.client.ui;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.ListCell;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.paint.Color;
|
||||
|
||||
import envoy.data.Contact;
|
||||
import envoy.data.Group;
|
||||
@ -32,32 +31,19 @@ public class ContactListCell extends ListCell<Contact> {
|
||||
setText(null);
|
||||
setGraphic(null);
|
||||
} else {
|
||||
// the infoLabel displays specific contact info, i.e. status of a user or amount
|
||||
// of members in a group
|
||||
Label infoLabel = null;
|
||||
// Container with contact name
|
||||
final var vbox = new VBox(new Label(contact.getName()));
|
||||
if (contact instanceof User) {
|
||||
// user specific info
|
||||
infoLabel = new Label(((User) contact).getStatus().toString());
|
||||
Color textColor = null;
|
||||
switch (((User) contact).getStatus()) {
|
||||
case ONLINE:
|
||||
textColor = Color.LIMEGREEN;
|
||||
break;
|
||||
case AWAY:
|
||||
textColor = Color.ORANGERED;
|
||||
break;
|
||||
case BUSY:
|
||||
textColor = Color.RED;
|
||||
break;
|
||||
case OFFLINE:
|
||||
textColor = Color.GRAY;
|
||||
break;
|
||||
}
|
||||
infoLabel.setTextFill(textColor);
|
||||
} else
|
||||
// group specific infos
|
||||
infoLabel = new Label(String.valueOf(((Group) contact).getContacts().size()) + " members");
|
||||
setGraphic(new VBox(new Label(contact.getName()), infoLabel));
|
||||
// Online status
|
||||
final var user = (User) contact;
|
||||
final var statusLabel = new Label(user.getStatus().toString());
|
||||
statusLabel.getStyleClass().add(user.getStatus().toString().toLowerCase());
|
||||
vbox.getChildren().add(statusLabel);
|
||||
} else {
|
||||
// Member count
|
||||
vbox.getChildren().add(new Label(((Group) contact).getContacts().size() + " members"));
|
||||
}
|
||||
setGraphic(vbox);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public final class ChatScene {
|
||||
if (chat.equals(currentChat)) {
|
||||
try {
|
||||
currentChat.read(writeProxy);
|
||||
} catch (IOException e1) {
|
||||
} catch (final IOException e1) {
|
||||
logger.log(Level.WARNING, "Could not read current chat: ", e1);
|
||||
}
|
||||
Platform.runLater(messageList::refresh);
|
||||
@ -177,7 +177,7 @@ public final class ChatScene {
|
||||
// Read the current chat
|
||||
try {
|
||||
currentChat.read(writeProxy);
|
||||
} catch (IOException e) {
|
||||
} catch (final IOException e) {
|
||||
logger.log(Level.WARNING, "Could not read current chat.", e);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user