Moved remainingCharsLabel styling from code to CSS

This commit is contained in:
delvh 2020-06-21 17:04:27 +02:00
parent ef40c171d9
commit d389637259
3 changed files with 7 additions and 5 deletions

View File

@ -85,10 +85,6 @@ public final class ChatScene {
messageList.setCellFactory(listView -> new MessageListCell());
userList.setCellFactory(listView -> new ContactListCell());
// Unfortunately, remainingChars.setTextFill(...) does not work as it is most
// likely overridden by CSS
remainingChars.setStyle("-fx-text-fill: #00FF00; -fx-opacity: 1; -fx-background-color: transparent;");
// Listen to received messages
eventBus.register(MessageCreationEvent.class, e -> {
final var message = e.get();

View File

@ -6,3 +6,9 @@
-fx-scale-x: 1.05;
-fx-scale-y: 1.05;
}
#remainingCharsLabel {
-fx-text-fill: #00FF00;
-fx-opacity: 1;
-fx-background-color: transparent;
}

View File

@ -76,7 +76,7 @@
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</GridPane.margin>
</Button>
<Label fx:id="remainingChars" disable="true" ellipsisString="" maxHeight="30.0" maxWidth="180.0" prefHeight="30.0" prefWidth="180.0" text="remaining chars: 0/x" textFill="LIME" textOverrun="LEADING_WORD_ELLIPSIS" visible="false" GridPane.columnIndex="1" GridPane.rowIndex="2">
<Label id="remainingCharsLabel" fx:id="remainingChars" ellipsisString="" maxHeight="30.0" maxWidth="180.0" prefHeight="30.0" prefWidth="180.0" text="remaining chars: 0/x" textFill="LIME" textOverrun="LEADING_WORD_ELLIPSIS" visible="false" GridPane.columnIndex="1" GridPane.rowIndex="2">
<GridPane.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</GridPane.margin>