Hello!
I know this is an ancient post, but the button fell off my P7Pro as well, and since this pops up in google I thought I'd leave a few notes.
If you look closely at the button, you'll notice that one of the inner sides has a blue-ish tab, and the other one doesn't. This tab helps keep the button in place in the device, but it seems that the factory glue is not durable enough. The missing tab is most probably still in your phone in the volume button slot, and you'll probably need a needle or very thin pliers to pick it out. Be careful as it's super tiny.
Now when you look at that tab closely you will notice that it has a flat side and a beveled side. The flat side is the one that should be glued to the volume button. If you have a friend that is into building/painting miniatures, this would be a good time to ask them to glue it back, as they are probably more used to handle such tiny parts and have better equipment. Otherwise, read on.
In order to glue it back correctly, I used some modeller glue(Revell contacta) because it's slower to dry and the needle-like part makes it easier to apply just enough glue. Any similar glue should do, and I'll advise against using instant glue as it dries too fast and the residue is harder to remove if you don't make it the first time. The volume button also has a couple of standouts to guide the tab in the correct place, so it shouldn't be too hard to glue it. Just add a tiny amount behind those, make sure the flat side of the tab is facing the glue, and push it in. Let it dry for a few minutes, and then you can try sliding it back in the phone by fitting first one side and then carefully pushing the other downwards and inwards.
Good luck.