Display "Follow"/"Unfollow" depending on the active tab
This commit is contained in:
parent
114e676917
commit
ea3715134e
|
@ -71,10 +71,11 @@ public class ThumbCell extends StackPane {
|
||||||
|
|
||||||
private HttpClient client;
|
private HttpClient client;
|
||||||
|
|
||||||
|
private ThumbOverviewTab parent;
|
||||||
private ObservableList<Node> thumbCellList;
|
private ObservableList<Node> thumbCellList;
|
||||||
|
|
||||||
|
|
||||||
public ThumbCell(ThumbOverviewTab parent, Model model, Recorder recorder, HttpClient client) {
|
public ThumbCell(ThumbOverviewTab parent, Model model, Recorder recorder, HttpClient client) {
|
||||||
|
this.parent = parent;
|
||||||
this.thumbCellList = parent.grid.getChildren();
|
this.thumbCellList = parent.grid.getChildren();
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.recorder = recorder;
|
this.recorder = recorder;
|
||||||
|
@ -200,7 +201,8 @@ public class ThumbCell extends StackPane {
|
||||||
contextMenu.setAutoHide(true);
|
contextMenu.setAutoHide(true);
|
||||||
contextMenu.setHideOnEscape(true);
|
contextMenu.setHideOnEscape(true);
|
||||||
contextMenu.setAutoFix(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;
|
return contextMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue