fix the progress bar in the files tab

This commit is contained in:
Damien Churchill 2009-06-01 22:23:47 +00:00
parent ff262acbdf
commit ed36526a24
4 changed files with 8 additions and 7 deletions

View File

@ -175,7 +175,7 @@ input {
font-size: 11px;
font-weight: normal;
padding: 0px;
margin-top: -1px;
margin-top: 0px;
}
.x-tree .x-progress-renderered .x-progress-bar .x-progress-text {

View File

@ -35,7 +35,7 @@ Copyright:
/* Renderers for the column tree */
function fileProgressRenderer(value) {
var progress = value * 100;
return Deluge.progressBar(progress, this.width - 50, progress.toFixed(2) + '%');
return Deluge.progressBar(progress, this.width - 50, progress.toFixed(2) + '%', 0);
}
function priorityRenderer(value) {
return String.format('<div class="{0}">{1}</div>', FILE_PRIORITY_CSS[value], _(FILE_PRIORITY[value]));
@ -199,4 +199,4 @@ Copyright:
}
});
Deluge.Details.add(new Ext.deluge.details.FilesTab());
})();
})();

View File

@ -77,10 +77,11 @@ Ext.namespace('Ext.deluge');
'</div>' +
'</div>';
Deluge.progressBar = function(progress, width, text) {
Deluge.progressBar = function(progress, width, text, modifier) {
modifier = Ext.value(modifier, 10);
var progressWidth = ((width / 100.0) * progress).toFixed(0);
var barWidth = progressWidth - 1;
var textWidth = ((progressWidth - 10) > 0 ? progressWidth - 10 : 0);
var textWidth = ((progressWidth - modifier) > 0 ? progressWidth - modifier : 0);
return String.format(tpl, text, width, barWidth, textWidth);
}
})();
@ -106,4 +107,4 @@ FILE_PRIORITY_CSS = {
1: 'x-normal-download',
2: 'x-high-download',
5: 'x-highest-download'
}
}

File diff suppressed because one or more lines are too long