Skip to content

Commit

Permalink
color channel name in green/red/gray for online/offline/unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
s1mpl3x committed Aug 20, 2015
1 parent 52a2e86 commit bf07e55
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main/java/eu/over9000/skadi/ui/cells/ChannelGridCell.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,16 @@ public class ChannelGridCell extends GridCell<Channel> {
private final VBox vBox;

private final ChannelGrid grid;
private final MainWindow mainWindow;

public ChannelGridCell(final ChannelGrid grid, final MainWindow mainWindow) {
this.grid = grid;
this.mainWindow = mainWindow;

getStyleClass().add(GRID_BOX);

name = new Label();
name.setPadding(new Insets(5));
name.setFont(new Font(12));
name.setStyle("-fx-font-weight: bold");


title = new Label();
title.setStyle("-fx-font-weight: bold");
Expand Down Expand Up @@ -111,6 +109,14 @@ protected void updateItem(final Channel item, final boolean empty) {
setText(null);
} else {
updateSelected(grid.isSelected(item));

if (item.isOnline() != null) {
if (item.isOnline()) {
name.setStyle("-fx-font-weight: bold;-fx-text-fill: green");
} else {
name.setStyle("-fx-font-weight: bold;-fx-text-fill: red");
}
}

name.textProperty().bind(item.nameProperty());

Expand Down

0 comments on commit bf07e55

Please sign in to comment.