Use theme colors
* Use theme colors * Improve aspect ratio handling for images. * Display images with rounded corners
This commit is contained in:
parent
ee38f0a049
commit
d571afaa44
|
@ -81,7 +81,7 @@ public class ThumbCell extends StackPane {
|
||||||
this.recorder = recorder;
|
this.recorder = recorder;
|
||||||
recording = recorder.isRecording(model);
|
recording = recorder.isRecording(model);
|
||||||
model.setSuspended(recorder.isSuspended(model));
|
model.setSuspended(recorder.isSuspended(model));
|
||||||
this.setStyle("-fx-background-color: lightgray");
|
this.setStyle("-fx-background-color: -fx-base");
|
||||||
|
|
||||||
iv = new ImageView();
|
iv = new ImageView();
|
||||||
iv.setSmooth(true);
|
iv.setSmooth(true);
|
||||||
|
@ -530,8 +530,14 @@ public class ThumbCell extends StackPane {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSize(int w, int h) {
|
private void setSize(int w, int h) {
|
||||||
iv.setFitWidth(w);
|
if(iv.getImage() != null) {
|
||||||
iv.setFitHeight(h);
|
double aspectRatio = iv.getImage().getWidth() / iv.getImage().getHeight();
|
||||||
|
if(aspectRatio > 1) {
|
||||||
|
iv.setFitWidth(w);
|
||||||
|
} else {
|
||||||
|
iv.setFitHeight(h);
|
||||||
|
}
|
||||||
|
}
|
||||||
setMinSize(w, h);
|
setMinSize(w, h);
|
||||||
setPrefSize(w, h);
|
setPrefSize(w, h);
|
||||||
nameBackground.setWidth(w);
|
nameBackground.setWidth(w);
|
||||||
|
@ -545,5 +551,10 @@ public class ThumbCell extends StackPane {
|
||||||
topic.setWrappingWidth(w-margin*2);
|
topic.setWrappingWidth(w-margin*2);
|
||||||
selectionOverlay.setWidth(w);
|
selectionOverlay.setWidth(w);
|
||||||
selectionOverlay.setHeight(getHeight());
|
selectionOverlay.setHeight(getHeight());
|
||||||
|
|
||||||
|
Rectangle clip = new Rectangle(w, h);
|
||||||
|
clip.setArcWidth(10);
|
||||||
|
clip.arcHeightProperty().bind(clip.arcWidthProperty());
|
||||||
|
this.setClip(clip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue