Custom widget user defined if statement

I used attention-with-button as a base, then I removed the button (because I didn’t like it) and added the possibility to change the highlight colour. Now I want to add the possibility to change the if-operator (I mean change between ==,<,>,!=,>= and <=). How is that possible? And is there a way to get widget size as text (or a number)?

My code looks like this:
https://gist.github.com/TheGreyDiamond/aeebcf109ec0c44245a1fa12749c4dd6