Have you communicated that?
“Hey, I’m busy earning money. Because I’m sitting and thinking doesn’t mean I’m slacking off, and I’m also quite surprised to hear that from my significant other. You don’t know what I’m doing right now and you’re not my manager, so stop controlling and managing my work time. You’re distracting me from my work so please leave me alone. If you can’t look at me thinking and doing my work then please look the other way or go to the other room. Thanks, bye.”
I’m dramatizing, but set boundaries. There’s personal time and work time. When it’s work, it’s work.