mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 06:58:42 +00:00
Only draw the advanced progress bar if 'num_pieces' is greater than 0.
This commit is contained in:
parent
7a973947a7
commit
4b18f49ec1
1 changed files with 10 additions and 9 deletions
|
@ -94,6 +94,7 @@ class DetailsTabManager(object):
|
|||
gc.set_foreground(colormap.alloc_color('#2020FF'))
|
||||
progress_window.draw_rectangle(gc, True, 0, top, int(size[0] * state['progress']), 4)
|
||||
num_pieces = state["total_wanted"] / state["piece_length"]
|
||||
if num_pieces > 0:
|
||||
for pieces_range in state['pieces']:
|
||||
range_first = pieces_range[0] * size[0] / num_pieces
|
||||
range_length = ((pieces_range[1] - pieces_range[0] + 1) * size[0] / num_pieces)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue