Not to disagree, but my headcanon is that he gave her the hat after she came back from the Oranges.