@@ -52,11 +52,17 @@ def wheelEvent(self, event):
5252 # super will actually automatically take care of zooming
5353 super (MessageView , self ).wheelEvent (event )
5454 if (
55- QtGui .QApplication .queryKeyboardModifiers () & QtCore .Qt .ControlModifier
56- ) == QtCore .Qt .ControlModifier and event .orientation () == QtCore .Qt .Vertical :
57- zoom = self .currentFont ().pointSize () * 100 / self .defaultFontPointSize
58- QtGui .QApplication .activeWindow ().statusBar ().showMessage (_translate (
59- "MainWindow" , "Zoom level %1%" ).arg (str (zoom )))
55+ QtGui .QApplication .queryKeyboardModifiers ()
56+ & QtCore .Qt .ControlModifier ) == \
57+ QtCore .Qt .ControlModifier \
58+ and event .orientation () == QtCore .Qt .Vertical :
59+ zoom = self .currentFont ().pointSize () \
60+ * 100 \
61+ / self .defaultFontPointSize
62+ QtGui .QApplication .activeWindow ().statusBar ().\
63+ showMessage (_translate ("MainWindow" ,
64+ "Zoom level %1%" ).\
65+ arg (str (zoom )))
6066
6167 def setWrappingWidth (self , width = None ):
6268 """Set word-wrapping width"""
@@ -114,17 +120,21 @@ def lazyRender(self):
114120 self .rendering = True
115121 position = self .verticalScrollBar ().value ()
116122 cursor = QtGui .QTextCursor (self .document ())
117- while self .outpos < len (self .out ) and self .verticalScrollBar ().value (
118- ) >= self .document ().size ().height () - 2 * self .size ().height ():
123+ while self .outpos < len (self .out ) \
124+ and self .verticalScrollBar ().value () \
125+ >= self .document ().size ().height () \
126+ - 2 * self .size ().height ():
119127 startpos = self .outpos
120128 self .outpos += 10240
121129 # find next end of tag
122130 if self .mode == MessageView .MODE_HTML :
123131 pos = self .out .find (">" , self .outpos )
124132 if pos > self .outpos :
125133 self .outpos = pos + 1
126- cursor .movePosition (QtGui .QTextCursor .End , QtGui .QTextCursor .MoveAnchor )
127- cursor .insertHtml (QtCore .QString (self .out [startpos :self .outpos ]))
134+ cursor .movePosition (QtGui .QTextCursor .End ,
135+ QtGui .QTextCursor .MoveAnchor )
136+ cursor .insertHtml (
137+ QtCore .QString (self .out [startpos :self .outpos ]))
128138 self .verticalScrollBar ().setValue (position )
129139 self .rendering = False
130140
0 commit comments