Fix progress bar being red hopefully.
This commit is contained in:
parent
5342b88519
commit
f893b11f1b
1
TODO
1
TODO
@ -1,7 +1,6 @@
|
||||
Bugs
|
||||
====
|
||||
|
||||
progress bar is often red
|
||||
All kind of FIXMEs
|
||||
Weird font rendering
|
||||
https://bugreports.qt-project.org/browse/QTBUG-20973
|
||||
|
@ -62,10 +62,9 @@ class MainWindow(QMainWindow):
|
||||
|
||||
self.status.resized.connect(self.completion.resize_to_bar)
|
||||
self.status.moved.connect(self.completion.move_to_bar)
|
||||
self.tabs.cur_progress.connect(self.status.prog.set_progress)
|
||||
self.tabs.cur_progress.connect(self.status.prog.setValue)
|
||||
self.tabs.cur_load_finished.connect(self.status.prog.load_finished)
|
||||
self.tabs.cur_load_started.connect(lambda:
|
||||
self.status.prog.set_progress(0))
|
||||
self.tabs.cur_load_started.connect(self.status.prog.on_load_started)
|
||||
self.tabs.cur_scroll_perc_changed.connect(
|
||||
self.status.percentage.set_perc)
|
||||
self.tabs.cur_statusbar_message.connect(self.status.txt.setText)
|
||||
|
@ -348,12 +348,11 @@ class Progress(QProgressBar):
|
||||
self._error = val
|
||||
self.setStyleSheet(config.get_stylesheet(self._stylesheet))
|
||||
|
||||
def set_progress(self, prog):
|
||||
"""Set the progress of the bar and show/hide it if necessary."""
|
||||
self.setValue(prog)
|
||||
if prog != 100:
|
||||
self.error = False
|
||||
self.show()
|
||||
def on_load_started(self):
|
||||
"""Clear old error and show progress, used as slot to loadStarted."""
|
||||
self.setValue(0)
|
||||
self.error = False
|
||||
self.show()
|
||||
|
||||
def load_finished(self, ok):
|
||||
"""Hide the progress bar or color it red, depending on ok.
|
||||
|
Loading…
Reference in New Issue
Block a user