From ea3715134ee2b267074d48f47da9c77e14875bb0 Mon Sep 17 00:00:00 2001 From: 0xboobface <0xboobface@gmail.com> Date: Thu, 5 Jul 2018 16:26:55 +0200 Subject: [PATCH] Display "Follow"/"Unfollow" depending on the active tab --- src/main/java/ctbrec/ui/ThumbCell.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/ctbrec/ui/ThumbCell.java b/src/main/java/ctbrec/ui/ThumbCell.java index 0bfdb56f..be6f4faf 100644 --- a/src/main/java/ctbrec/ui/ThumbCell.java +++ b/src/main/java/ctbrec/ui/ThumbCell.java @@ -71,10 +71,11 @@ public class ThumbCell extends StackPane { private HttpClient client; + private ThumbOverviewTab parent; private ObservableList 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; }