I'm sure things depend on your current health, weight and diet and, of course, everyone is different BUT:
I had a fracture of the tibial plateau in March this year. So, that is the top of the tibia right by the knee, and given the nature and location of the fracture, there was no operation, no plaster on the leg (and basically no help of any kind offered either,😡), but was told to use crutches and keep all weight off the leg for seven weeks.
Well, I was actually told I could put a maximum of 20 kilos weight on the leg, but that hurt way too much and I was also terrified of putting more weight on the leg accidentally and causing unfixable harm.
So that meant either lying down, sitting up moving as little as possible with one leg propped up, or dragging myself around the flat on crutches. (The idea of trying to leave the flat was unthinkable. Just the idea of getting down the staircase from our flat felt impossible).
And I lost about 7 kilos during that period. That put me from being in the overweight category of BMI into the top end of 'normal'.
This was partly intended. I was very aware that moving around so much less meant I was at risk of gaining weight, so I drastically reduced the amount of carbs I ate. I skipped breakfast, lunches were either soup made by chucking a bunch of roughly chopped vegetables in a saucepan or salad and feta.
The agony of using crutches also gave me a strong motivation to reduce the weight that I had to support using those crutches.
It was also because every aspect of trying to prepare food was so so DIFFICULT on crutches. Getting stuff out of the fridge, chopping, cooking, serving, moving food from the kitchen worktop to the table, it was all so much harder. So that was a great motivation for doing it as little as possible. And getting a snack would have been so difficult that I just didn't do it.
I'm post menopausal and the weight had been slowly creeping up for years despite my continuing to exercise and trying to maintain a healthy diet, so I'd actually resigned myself to the idea that weight gain was inevitable given my age. Turned out it wasn't inevitable.
By the way, I'm sure you're aware already, but you will lose muscle in the affected leg, and you will probably lose fitness due to the enforced lack of mobility. But physiotherapy afterwards, though fairly excruciating, really does help a huge amount.
Good luck.