From 149f3516739520d02249c0f5f83f3c79bf5d6f9f Mon Sep 17 00:00:00 2001 From: DieGurke <55625494+DieGurke@users.noreply.github.com> Date: Thu, 16 Jul 2020 19:07:27 +0200 Subject: [PATCH] Fixed styleSheet mess regarding the Lists --- .../java/envoy/client/ui/listcell/ChatControl.java | 2 +- .../envoy/client/ui/listcell/ContactControl.java | 1 + .../envoy/client/ui/listcell/ListCellFactory.java | 5 ++++- client/src/main/resources/css/dark.css | 13 ++++++++++++- client/src/main/resources/fxml/ChatScene.fxml | 6 +++--- 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/client/src/main/java/envoy/client/ui/listcell/ChatControl.java b/client/src/main/java/envoy/client/ui/listcell/ChatControl.java index c2e942c..a0bd640 100644 --- a/client/src/main/java/envoy/client/ui/listcell/ChatControl.java +++ b/client/src/main/java/envoy/client/ui/listcell/ChatControl.java @@ -28,7 +28,6 @@ public class ChatControl extends HBox { // Contact control getChildren().add(new ContactControl(chat.getRecipient())); - // Unread messages if (chat.getUnreadAmount() != 0) { Region spacing = new Region(); @@ -43,5 +42,6 @@ public class ChatControl extends HBox { vBox2.getChildren().add(unreadMessagesLabel); getChildren().add(vBox2); } + getStyleClass().add("listElement"); } } diff --git a/client/src/main/java/envoy/client/ui/listcell/ContactControl.java b/client/src/main/java/envoy/client/ui/listcell/ContactControl.java index c8f9107..eb4a483 100644 --- a/client/src/main/java/envoy/client/ui/listcell/ContactControl.java +++ b/client/src/main/java/envoy/client/ui/listcell/ContactControl.java @@ -39,5 +39,6 @@ public class ContactControl extends VBox { } else { getChildren().add(new Label(contact.getContacts().size() + " members")); } + getStyleClass().add("listElement"); } } diff --git a/client/src/main/java/envoy/client/ui/listcell/ListCellFactory.java b/client/src/main/java/envoy/client/ui/listcell/ListCellFactory.java index 86270ce..db7483f 100644 --- a/client/src/main/java/envoy/client/ui/listcell/ListCellFactory.java +++ b/client/src/main/java/envoy/client/ui/listcell/ListCellFactory.java @@ -25,7 +25,10 @@ public final class ListCellFactory implements Callback, ListCell< private ListView listView; - private GenericListCell(ListView listView) { this.listView = listView; } + private GenericListCell(ListView listView) { + this.listView = listView; + getStyleClass().add("listElement"); + } @Override protected void updateItem(T item, boolean empty) { diff --git a/client/src/main/resources/css/dark.css b/client/src/main/resources/css/dark.css index 52c8663..7cbc145 100644 --- a/client/src/main/resources/css/dark.css +++ b/client/src/main/resources/css/dark.css @@ -18,7 +18,7 @@ -fx-background-color: lightgray; } -.list-view, .list-cell, #messageEnterContainer, .text-field, .password-field, .tooltip, .pane, .pane .content, .vbox, .titled-pane > .title, .titled-pane > *.content, .context-menu, .menu-item { +#messageList, .text-field, .password-field, .tooltip, .pane, .pane .content, .vbox, .titled-pane > .title, .titled-pane > *.content, .context-menu, .menu-item { -fx-background-color: #262626; } @@ -46,3 +46,14 @@ -fx-background-color: rgb(25, 25, 25); } +#chatList { + -fx-background-color: #303030; +} + +.listElement { + -fx-background-color: transparent; +} + +#messageEnterContainer { + -fx-background-color: #363636; +} diff --git a/client/src/main/resources/fxml/ChatScene.fxml b/client/src/main/resources/fxml/ChatScene.fxml index 2422464..29d9f08 100644 --- a/client/src/main/resources/fxml/ChatScene.fxml +++ b/client/src/main/resources/fxml/ChatScene.fxml @@ -28,9 +28,9 @@ - + - + @@ -59,7 +59,7 @@ - +