Make it a real Document property, updated at init & toggle time. Also, simplify a bunch of redundant nested lookups in ReaderView (self.ui.view is self, self.ui.document is self.document).