Commit be3911c9 authored by Jordi Romera's avatar Jordi Romera

Allow progress to decrease in ProgressBar

parent 62ff3979
......@@ -74,12 +74,14 @@ class ProgressBar(Gtk.ProgressBar):
self.__progress_running = False
return
current = self.get_fraction()
# Compute a smoothly progress
if self.__fraction < 1:
progress = (self.__fraction - current) / 10
else:
progress = 0.01
if current < self.__fraction:
Gtk.ProgressBar.set_fraction(self, current + progress)
# Apply new fraction with smoothly effect
Gtk.ProgressBar.set_fraction(self, current + progress)
# Call next update
if current < 1.0:
GLib.timeout_add(10, self.__progress_update, caller)
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment