Fixed styleSheet mess regarding the Lists

This commit is contained in:
DieGurke 2020-07-16 19:07:27 +02:00
parent b156400227
commit 149f351673
5 changed files with 21 additions and 6 deletions

View File

@ -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");
}
}

View File

@ -39,5 +39,6 @@ public class ContactControl extends VBox {
} else {
getChildren().add(new Label(contact.getContacts().size() + " members"));
}
getStyleClass().add("listElement");
}
}

View File

@ -25,7 +25,10 @@ public final class ListCellFactory<T> implements Callback<ListView<T>, ListCell<
private ListView<? extends T> listView;
private GenericListCell(ListView<? extends T> listView) { this.listView = listView; }
private GenericListCell(ListView<? extends T> listView) {
this.listView = listView;
getStyleClass().add("listElement");
}
@Override
protected void updateItem(T item, boolean empty) {

View File

@ -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;
}

View File

@ -28,9 +28,9 @@
<RowConstraints maxHeight="120.0" minHeight="40.0" prefHeight="83.333251953125" vgrow="NEVER" />
</rowConstraints>
<children>
<ListView fx:id="chatList" onMouseClicked="#chatListClicked" prefHeight="211.0" prefWidth="300.0" GridPane.rowIndex="1" GridPane.rowSpan="2147483647">
<ListView id="chatList" fx:id="chatList" onMouseClicked="#chatListClicked" prefHeight="211.0" prefWidth="300.0" GridPane.rowIndex="1" GridPane.rowSpan="2147483647">
<GridPane.margin>
<Insets right="4.0" top="1.0" />
<Insets right="2.0" top="1.0" />
</GridPane.margin>
<padding>
<Insets bottom="5.0" left="5.0" right="2.0" top="5.0" />
@ -59,7 +59,7 @@
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</Button>
<ListView fx:id="messageList" GridPane.columnIndex="1" GridPane.columnSpan="2147483647" GridPane.rowIndex="1" GridPane.rowSpan="2">
<ListView id="messageList" fx:id="messageList" GridPane.columnIndex="1" GridPane.columnSpan="2147483647" GridPane.rowIndex="1" GridPane.rowSpan="2">
<GridPane.margin>
<Insets />
</GridPane.margin>