Skip to content
Snippets Groups Projects
Commit 2f417dbc authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #88 - truncate payment name in PaymentCell

parent a06512d0
No related branches found
No related tags found
1 merge request!104merge v_1_2_0 into master
...@@ -74,6 +74,7 @@ public class PaymentController implements Refreshable ...@@ -74,6 +74,7 @@ public class PaymentController implements Refreshable
} }
} }
}); });
cell.prefWidthProperty().bind(listView.widthProperty().subtract(2));
return cell; return cell;
} }
}); });
......
...@@ -69,6 +69,7 @@ public class PaymentCell extends ListCell<Payment> ...@@ -69,6 +69,7 @@ public class PaymentCell extends ListCell<Payment>
labelDate.setAlignment(Pos.CENTER); labelDate.setAlignment(Pos.CENTER);
labelDate.getStyleClass().add("greylabel"); labelDate.getStyleClass().add("greylabel");
labelDate.setStyle("-fx-font-weight: bold; -fx-font-size: 16; -fx-text-fill: #212121"); labelDate.setStyle("-fx-font-weight: bold; -fx-font-size: 16; -fx-text-fill: #212121");
labelDate.setMinWidth(75);
hbox.getChildren().add(labelDate); hbox.getChildren().add(labelDate);
FontIcon iconRepeating = new FontIcon(FontIconType.CALENDAR); FontIcon iconRepeating = new FontIcon(FontIconType.CALENDAR);
...@@ -88,7 +89,7 @@ public class PaymentCell extends ListCell<Payment> ...@@ -88,7 +89,7 @@ public class PaymentCell extends ListCell<Payment>
labelRepeating.setAlignment(Pos.CENTER); labelRepeating.setAlignment(Pos.CENTER);
labelRepeating.getStyleClass().add("greylabel"); labelRepeating.getStyleClass().add("greylabel");
hbox.getChildren().add(labelRepeating); hbox.getChildren().add(labelRepeating);
HBox.setMargin(labelRepeating, new Insets(0, 30, 0, 15)); HBox.setMargin(labelRepeating, new Insets(0, 20, 0, 15));
String categoryName = category.getName(); String categoryName = category.getName();
if(categoryName.equals("NONE")) if(categoryName.equals("NONE"))
...@@ -97,8 +98,8 @@ public class PaymentCell extends ListCell<Payment> ...@@ -97,8 +98,8 @@ public class PaymentCell extends ListCell<Payment>
} }
Label labelCircle = new Label(categoryName.substring(0, 1).toUpperCase()); Label labelCircle = new Label(categoryName.substring(0, 1).toUpperCase());
labelCircle.setPrefWidth(HEIGHT); labelCircle.setMinWidth(HEIGHT);
labelCircle.setPrefHeight(HEIGHT); labelCircle.setMinHeight(HEIGHT);
labelCircle.setAlignment(Pos.CENTER); labelCircle.setAlignment(Pos.CENTER);
labelCircle.getStyleClass().add("greylabel"); labelCircle.getStyleClass().add("greylabel");
String textColor = ConvertTo.toRGBHex(ConvertTo.getAppropriateTextColor(category.getColor())); String textColor = ConvertTo.toRGBHex(ConvertTo.getAppropriateTextColor(category.getColor()));
...@@ -108,7 +109,6 @@ public class PaymentCell extends ListCell<Payment> ...@@ -108,7 +109,6 @@ public class PaymentCell extends ListCell<Payment>
labelCircle.setTooltip(tooltip); labelCircle.setTooltip(tooltip);
hbox.getChildren().add(labelCircle); hbox.getChildren().add(labelCircle);
Label labelName = new Label(item.getName()); Label labelName = new Label(item.getName());
labelName.setPrefHeight(HEIGHT); labelName.setPrefHeight(HEIGHT);
labelName.setStyle("-fx-font-weight: bold; -fx-font-size: 16; -fx-text-fill: #212121"); labelName.setStyle("-fx-font-weight: bold; -fx-font-size: 16; -fx-text-fill: #212121");
...@@ -126,6 +126,7 @@ public class PaymentCell extends ListCell<Payment> ...@@ -126,6 +126,7 @@ public class PaymentCell extends ListCell<Payment>
labelBudget.setStyle("-fx-font-weight: bold; -fx-font-size: 16; -fx-text-fill: #247A2D"); labelBudget.setStyle("-fx-font-weight: bold; -fx-font-size: 16; -fx-text-fill: #247A2D");
labelBudget.setAlignment(Pos.CENTER); labelBudget.setAlignment(Pos.CENTER);
labelBudget.getStyleClass().add("greylabel"); labelBudget.getStyleClass().add("greylabel");
labelBudget.setMinWidth(90);
hbox.getChildren().add(labelBudget); hbox.getChildren().add(labelBudget);
HBox.setMargin(labelBudget, new Insets(0, 0, 0, 20)); HBox.setMargin(labelBudget, new Insets(0, 0, 0, 20));
...@@ -185,14 +186,14 @@ public class PaymentCell extends ListCell<Payment> ...@@ -185,14 +186,14 @@ public class PaymentCell extends ListCell<Payment>
} }
}); });
hbox.getChildren().add(buttonDelete); hbox.getChildren().add(buttonDelete);
HBox.setMargin(buttonDelete, new Insets(0, 0, 0, 25)); HBox.setMargin(buttonDelete, new Insets(0, 0, 0, 10));
// don't allow "Übertrag" to be deleted // don't allow "Übertrag" to be deleted
if(item.getID() == -1) if(item.getID() == -1)
{ {
buttonDelete.setVisible(false); buttonDelete.setVisible(false);
} }
hbox.setPadding(new Insets(10)); hbox.setPadding(new Insets(10, 8, 10, 5));
setStyle("-fx-background: transparent; -fx-border-color: #545454; -fx-border-width: 0 0 1 0"); setStyle("-fx-background: transparent; -fx-border-color: #545454; -fx-border-width: 0 0 1 0");
setGraphic(hbox); setGraphic(hbox);
setAlignment(Pos.CENTER); setAlignment(Pos.CENTER);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment