mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Prevent loading overlay from slowing actual loading
The python GIL means quick pre-emption is too costly
This commit is contained in:
parent
5385df337e
commit
96ebc4bda3
@ -22,7 +22,7 @@ class LoadingOverlay(QWidget):
|
|||||||
self.move(0, 0)
|
self.move(0, 0)
|
||||||
self.angle = 0
|
self.angle = 0
|
||||||
self.timer = t = QTimer(self)
|
self.timer = t = QTimer(self)
|
||||||
t.setInterval(10)
|
t.setInterval(60)
|
||||||
t.timeout.connect(self.tick)
|
t.timeout.connect(self.tick)
|
||||||
f = self.font()
|
f = self.font()
|
||||||
f.setBold(True)
|
f.setBold(True)
|
||||||
@ -32,7 +32,7 @@ class LoadingOverlay(QWidget):
|
|||||||
self.calculate_rects()
|
self.calculate_rects()
|
||||||
|
|
||||||
def tick(self):
|
def tick(self):
|
||||||
self.angle -= 2
|
self.angle -= 6
|
||||||
self.angle %= 360
|
self.angle %= 360
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
@ -43,6 +43,7 @@ class LoadingOverlay(QWidget):
|
|||||||
self.setVisible(True)
|
self.setVisible(True)
|
||||||
self.raise_()
|
self.raise_()
|
||||||
self.setFocus(Qt.OtherFocusReason)
|
self.setFocus(Qt.OtherFocusReason)
|
||||||
|
self.update()
|
||||||
|
|
||||||
def hide(self):
|
def hide(self):
|
||||||
self.parent().web_view.setFocus(Qt.OtherFocusReason)
|
self.parent().web_view.setFocus(Qt.OtherFocusReason)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user