In this geometrical approach to gravitational lensing theory, we apply the Gauss-Bonnet theorem to the optical metric of a lens, modelled as a static, spherically symmetric, perfect non-relativistic fluid, in the weak deflection limit. We find that the focusing of the light rays emerges here as a topological effect, and we introduce a new method to calculate the deflection angle from the Gaussian curvature of the optical metric. As examples, the Schwarzschild lens, the Plummer sphere and the singular isothermal sphere are discussed within this framework.