private boolean isInContent(@NotNull Component component) {
    // This check is just in case we have something scrollable in the toolbar.
    var parent = component;
    while (parent != null) {
      if (parent == myToolbar) {
        return false;
      }
      else if (parent == myContent) {
        return true;
      }
      parent = parent.getParent();
    }
    return false;
  }
private boolean isInContent(@NotNull Component component)