Hide resolution tag, when mouse is hovering over ThumbCell
This is done, because the resolution tag might obscure the channel description
This commit is contained in:
parent
be16c333e2
commit
e4eda35d02
|
@ -75,6 +75,7 @@ public class ThumbCell extends StackPane {
|
||||||
private HttpClient client;
|
private HttpClient client;
|
||||||
|
|
||||||
private ObservableList<Node> thumbCellList;
|
private ObservableList<Node> thumbCellList;
|
||||||
|
private boolean mouseHovering = false;
|
||||||
|
|
||||||
public ThumbCell(ThumbOverviewTab parent, Model model, Recorder recorder, HttpClient client) {
|
public ThumbCell(ThumbOverviewTab parent, Model model, Recorder recorder, HttpClient client) {
|
||||||
this.thumbCellList = parent.grid.getChildren();
|
this.thumbCellList = parent.grid.getChildren();
|
||||||
|
@ -156,12 +157,22 @@ public class ThumbCell extends StackPane {
|
||||||
getChildren().add(selectionOverlay);
|
getChildren().add(selectionOverlay);
|
||||||
|
|
||||||
setOnMouseEntered((e) -> {
|
setOnMouseEntered((e) -> {
|
||||||
|
mouseHovering = true;
|
||||||
new ParallelTransition(changeColor(nameBackground, colorNormal, colorHighlight), changeColor(name, colorHighlight, colorNormal)).playFromStart();
|
new ParallelTransition(changeColor(nameBackground, colorNormal, colorHighlight), changeColor(name, colorHighlight, colorNormal)).playFromStart();
|
||||||
new ParallelTransition(changeOpacity(topicBackground, 0.7), changeOpacity(topic, 0.7)).playFromStart();
|
new ParallelTransition(changeOpacity(topicBackground, 0.7), changeOpacity(topic, 0.7)).playFromStart();
|
||||||
|
if(Config.getInstance().getSettings().determineResolution) {
|
||||||
|
resolutionBackground.setVisible(false);
|
||||||
|
resolutionTag.setVisible(false);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
setOnMouseExited((e) -> {
|
setOnMouseExited((e) -> {
|
||||||
|
mouseHovering = false;
|
||||||
new ParallelTransition(changeColor(nameBackground, colorHighlight, colorNormal), changeColor(name, colorNormal, colorHighlight)).playFromStart();
|
new ParallelTransition(changeColor(nameBackground, colorHighlight, colorNormal), changeColor(name, colorNormal, colorHighlight)).playFromStart();
|
||||||
new ParallelTransition(changeOpacity(topicBackground, 0), changeOpacity(topic, 0)).playFromStart();
|
new ParallelTransition(changeOpacity(topicBackground, 0), changeOpacity(topic, 0)).playFromStart();
|
||||||
|
if(Config.getInstance().getSettings().determineResolution) {
|
||||||
|
resolutionBackground.setVisible(true);
|
||||||
|
resolutionTag.setVisible(true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
setThumbWidth(width);
|
setThumbWidth(width);
|
||||||
|
|
||||||
|
@ -235,8 +246,10 @@ public class ThumbCell extends StackPane {
|
||||||
final Paint c = resolutionBackgroundColor;
|
final Paint c = resolutionBackgroundColor;
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
resolutionTag.setText(resText);
|
resolutionTag.setText(resText);
|
||||||
resolutionTag.setVisible(true);
|
if(!mouseHovering) {
|
||||||
resolutionBackground.setVisible(true);
|
resolutionTag.setVisible(true);
|
||||||
|
resolutionBackground.setVisible(true);
|
||||||
|
}
|
||||||
resolutionBackground.setWidth(resolutionTag.getBoundsInLocal().getWidth() + 4);
|
resolutionBackground.setWidth(resolutionTag.getBoundsInLocal().getWidth() + 4);
|
||||||
resolutionBackground.setFill(c);
|
resolutionBackground.setFill(c);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue