I feel your pain. In the year before I got pregnant I lost almost 40lbs and was really stoked about it. I am 27 weeks now and have gained 23lbs. I try to remind myself that a good chunk of the weight is amniotic fluid, the baby, and all the extra blood we have now. You have almost 50% more blood than you did before and liquid of any kind weighs a lot. I also remind myself to eat healthier food. But I don't always. And lastly that the weight I am gaining is for the baby and then I don't feel too bad about it. Chin up, think of it as being drought and famine resistant for the baby.
You can't really diet, but what i do is avoid sweets and fatty food, and eat lots of veggies and fruit. If i feel like a snack, i make a plate full of raw veggies (carrots, cucumber, cherry tomatoes, radish, ...) There is no limit on howmuch you can eat of that. My other snacks are fruit, nuts, ... just healthy stuff. And if i'm tired of drinking boring water, i make my own (infusion) ice tea, i pick a tea with fruits or so, that is already a bit sweet, and add some fresh orange juice or so to sweeten it a bit more. Or just squeeze a lemon and add that to my bottle of water with some mint leaves.