web: more progressbar fixes

Fix displaying the progress bars within the peers tab, also
reduce the modifier so that the bars don't overflow their
containers.
This commit is contained in:
Damien Churchill 2011-10-05 02:05:58 +01:00
parent 4ab5c6d9de
commit 2853d028fd
2 changed files with 5 additions and 4 deletions

View File

@ -101,7 +101,7 @@ Ext.apply(Deluge, {
// private
progressTpl: '<div class="x-progress x-progress-default">' +
'<div class="x-progress-text x-progress-text-back" style="width: {1}px;">{0}</div>' +
'<div class="x-progress-bar" style="width: {2}px;">' +
'<div class="x-progress-bar" style="width: {3}px;">' +
'<div class="x-progress-text" style="width: {1}px;">{0}</div>' +
'</div>' +
'</div>',
@ -116,7 +116,7 @@ Ext.apply(Deluge, {
* @param {Number} modified Amount to subtract from the width allowing for fixes
*/
progressBar: function(progress, width, text, modifier) {
modifier = Ext.value(modifier, 10);
modifier = Ext.value(modifier, 5);
var progressWidth = ((width / 100.0) * progress).toFixed(0);
var barWidth = progressWidth - 1;
var textWidth = ((progressWidth - modifier) > 0 ? progressWidth - modifier : 0);

View File

@ -84,8 +84,9 @@ Ext.define('Deluge.details.PeersTab', {
width: 150,
sortable: true,
renderer: function(v) {
var progress = (v * 100).toFixed(0);
return Deluge.progressBar(progress, this.width - 8, progress + '%');
var progress = (v * 100).toFixed(0),
width = this.query('gridcolumn[dataIndex=progress]')[0].getWidth();
return Deluge.progressBar(progress, width - 8, progress + '%');
}
}, {
text: 'Down Speed',