Set backbround of ThumbCell to lightgray

This commit is contained in:
0xboobface 2018-10-26 16:13:44 +02:00
parent 209ec64e3d
commit a31bad7466
1 changed files with 5 additions and 4 deletions

View File

@ -81,12 +81,12 @@ public class ThumbCell extends StackPane {
this.model = model;
this.recorder = recorder;
recording = recorder.isRecording(model);
this.setStyle("-fx-background-color: lightgray");
iv = new ImageView();
setImage(model.getPreview());
iv.setSmooth(true);
iv.setPreserveRatio(true);
iv.setStyle("-fx-background-color: #000");
setImage(model.getPreview());
getChildren().add(iv);
nameBackground = new Rectangle();
@ -258,9 +258,9 @@ public class ThumbCell extends StackPane {
@Override
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
if(newValue.doubleValue() == 1.0) {
imgAspectRatio = img.getHeight() / img.getWidth();
setThumbWidth(Config.getInstance().getSettings().thumbWidth);
//imgAspectRatio = img.getHeight() / img.getWidth();
iv.setImage(img);
setThumbWidth(Config.getInstance().getSettings().thumbWidth);
}
}
});
@ -480,6 +480,7 @@ public class ThumbCell extends StackPane {
public void setThumbWidth(int width) {
int height = (int) (width * imgAspectRatio);
setPrefSize(width, height);
setSize(width, height);
}