Do you think it would also help to replace the 2x4's with standard colonial posts or something? I had thought about the diagonals to help level things out but wasn't sure that would help with the load bearing aspect of the roof and what seems to be causing the leaning.
The load bearing is probably not a problem. You appear to have doubled 2 x 4's for each post. That's more than sufficient if the piece above, connecting the posts, is a doubled 2 x 8. You could perhaps get by if it's only a doubled 2 x 6. There really is not that much weight for each beam to bear.
Your concern needs to be the lateral instability of those window frames. They aren't doing much. And, as I said, some mechanical tie-downs. They make long, long threaded rods with tensioners just for this kind of application.
Diagonals, bolted to one another, right through the posts with 3/8" bolts will do a lot. You'll be surprised.
Of course, it would have been best if the original builder had used solid, continuous posts, right on down to the foundation. But he didn't. So, it's spend big bucks to rebuild it, or go with the most substantial after patching you can do.
But your big worry should be lift-off or collapse from winds, not merely load bearing. Gotta get that lateral sway stabilized, and get it tied down.
BTW........ Considering how those window frames were built, it wouldn't hurt to have someone come to take a look at the roof construction. Just to be safe. That's a lot of lumber to come ripping into your kitchen door, or to land on a neighbor's roof.
Here's an idea. I finished off one corner with three diagonals. The others just have a rough, untrimmed piece drawn to give you an idea of how it might not carry any aesthetic look with only one in place.
I'm lazy, so these are drawn in a square frame. You would have to do some angle calculating and bevel cutting to fit your gazebo.
A better view is below.