Genuinely wondering what it takes?

I’m wondering if a pretty girl really has to do much for men to think they can hit on her. I’ve been in an unhealthy very dissatisfying abusive relationship and I only have to be myself (polite) to a man to warrant unwanted attention. That’s it. My husband seems to think that I’m doing something extra to obtain the attention when in reality I think that if a man sees a pretty girl clearly neglected and unappreciated all he has to do is think that I have to smarten up at some point and they decide to make moves. I’m not in control of other people. I don’t want to have to be a massive bitch to every man I come into contact with. when a man hits on me I can clearly tell what is going on (sometimes I can’t) I am clear with boundaries and tell them to fuck off. So genuinely my question is: is me being nice in any manner the reason men are coming after me or does seeing me not being respected and appreciated hint that I could do better and so they take a chance?
Genuinely wondering what it takes?
Post Opinion