diff --git a/TODO b/TODO index 3c4daf6e9..013cb63d9 100644 --- a/TODO +++ b/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 diff --git a/qutebrowser/widgets/mainwindow.py b/qutebrowser/widgets/mainwindow.py index d44b04c0b..737878e99 100644 --- a/qutebrowser/widgets/mainwindow.py +++ b/qutebrowser/widgets/mainwindow.py @@ -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) diff --git a/qutebrowser/widgets/statusbar.py b/qutebrowser/widgets/statusbar.py index 634ce65e9..25c26fa25 100644 --- a/qutebrowser/widgets/statusbar.py +++ b/qutebrowser/widgets/statusbar.py @@ -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.