Display "Follow"/"Unfollow" depending on the active tab

This commit is contained in:
0xboobface 2018-07-05 16:26:55 +02:00
parent 114e676917
commit ea3715134e
1 changed files with 4 additions and 2 deletions

View File

@ -71,10 +71,11 @@ public class ThumbCell extends StackPane {
private HttpClient client;
private ThumbOverviewTab parent;
private ObservableList<Node> thumbCellList;
public ThumbCell(ThumbOverviewTab parent, Model model, Recorder recorder, HttpClient client) {
this.parent = parent;
this.thumbCellList = parent.grid.getChildren();
this.model = model;
this.recorder = recorder;
@ -200,7 +201,8 @@ public class ThumbCell extends StackPane {
contextMenu.setAutoHide(true);
contextMenu.setHideOnEscape(true);
contextMenu.setAutoFix(true);
contextMenu.getItems().addAll(openInPlayer, startStop , follow, unfollow);
MenuItem followOrUnFollow = parent instanceof FollowedTab ? unfollow : follow;
contextMenu.getItems().addAll(openInPlayer, startStop , followOrUnFollow);
return contextMenu;
}