diff --git a/src/main/java/envoy/client/ui/ContactListCell.java b/src/main/java/envoy/client/ui/ContactListCell.java index 5cb04ca..e52197d 100644 --- a/src/main/java/envoy/client/ui/ContactListCell.java +++ b/src/main/java/envoy/client/ui/ContactListCell.java @@ -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 { 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); } } } diff --git a/src/main/java/envoy/client/ui/controller/ChatScene.java b/src/main/java/envoy/client/ui/controller/ChatScene.java index 4dbca92..518b290 100644 --- a/src/main/java/envoy/client/ui/controller/ChatScene.java +++ b/src/main/java/envoy/client/ui/controller/ChatScene.java @@ -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); } diff --git a/src/main/resources/css/base.css b/src/main/resources/css/base.css index eeff6ef..4711344 100644 --- a/src/main/resources/css/base.css +++ b/src/main/resources/css/base.css @@ -1,3 +1,34 @@ .button { -fx-background-radius: 5em; } + +.button:hover { + -fx-scale-x: 1.05; + -fx-scale-y: 1.05; +} + +.label { + -fx-background-color: transparent; +} + +#remainingCharsLabel { + -fx-text-fill: #00FF00; + -fx-opacity: 1; + -fx-background-color: transparent; +} + +.online { + -fx-text-fill: limegreen; +} + +.away { + -fx-text-fill: orangered; +} + +.busy { + -fx-text-fill: red; +} + +.offline { + -fx-text-fill: gray; +} diff --git a/src/main/resources/css/dark.css b/src/main/resources/css/dark.css index e10a301..60707a4 100644 --- a/src/main/resources/css/dark.css +++ b/src/main/resources/css/dark.css @@ -1,4 +1,31 @@ -.button{ - -fx-background-color: rgb(105,0,153); +* { -fx-text-fill: white; } + +.root { + -fx-background-color: black; +} + +.button { + -fx-background-color: rgb(105.0,0.0,153.0); +} + +.button:pressed { + -fx-background-color: darkgray; +} + +.button:disabled { + -fx-background-color: lightgray; +} + +.list-view, .list-cell, .text-area .content, .text-field, .password-field, .tooltip, .pane, .pane .content, .vbox, .titled-pane > .title, .titled-pane > *.content { + -fx-background-color: dimgray; +} + +.list-cell:selected { + -fx-background-color:rgb(105.0,0.0,153.0) ; +} + +.alert.information.dialog-pane, .alert.warning.dialog-pane, .alert.error.dialog-pane { + -fx-background-color: black; +} diff --git a/src/main/resources/css/light.css b/src/main/resources/css/light.css index 34a1f74..bb57c4f 100644 --- a/src/main/resources/css/light.css +++ b/src/main/resources/css/light.css @@ -1,3 +1,3 @@ -.button{ - -fx-background-color: snow; +.button, .list-cell:selected{ + -fx-background-color: orangered; } diff --git a/src/main/resources/fxml/ChatScene.fxml b/src/main/resources/fxml/ChatScene.fxml index 5323930..9d95fba 100644 --- a/src/main/resources/fxml/ChatScene.fxml +++ b/src/main/resources/fxml/ChatScene.fxml @@ -5,6 +5,7 @@ + @@ -22,12 +23,51 @@ - - diff --git a/src/main/resources/fxml/ContactSearchScene.fxml b/src/main/resources/fxml/ContactSearchScene.fxml index 517b3e5..72fff81 100644 --- a/src/main/resources/fxml/ContactSearchScene.fxml +++ b/src/main/resources/fxml/ContactSearchScene.fxml @@ -23,30 +23,45 @@ - - - - + + + + + + +