}
{
- int w=0, h=0;
/* this is to determine the maximum width/height for the label */
- PangoLayout * pango_layout =
- gtk_widget_create_pango_layout( p->ul_lb, _( "999.99 KiB/s" ) );
+ int w=0, h=0;
+ char buf[64];
+ PangoLayout * pango_layout;
+ tr_formatter_speed_KBps( buf, 999.99, sizeof( buf ) );
+ pango_layout = gtk_widget_create_pango_layout( p->ul_lb, buf );
pango_layout_get_pixel_size( pango_layout, &w, &h );
gtk_widget_set_size_request( p->ul_lb, w, h );
gtk_widget_set_size_request( p->dl_lb, w, h );
w->setMaximumSize( HIG::PAD_BIG, 1 );
h->addWidget( w );
l = myDownloadSpeedLabel = new QLabel( this );
+ const int minimumSpeedWidth = l->fontMetrics().width( Formatter::speedToString(Speed::fromKBps(999.99)));
+ l->setMinimumWidth( minimumSpeedWidth );
+ l->setAlignment( Qt::AlignRight|Qt::AlignVCenter );
h->addWidget( l );
l = new QLabel( this );
l->setPixmap( getStockIcon( "go-down", QStyle::SP_ArrowDown ).pixmap( smallIconSize ) );
w->setMaximumSize( HIG::PAD_BIG, 1 );
h->addWidget( w );
l = myUploadSpeedLabel = new QLabel;
+ l->setMinimumWidth( minimumSpeedWidth );
+ l->setAlignment( Qt::AlignRight|Qt::AlignVCenter );
h->addWidget( l );
l = new QLabel;
l->setPixmap( getStockIcon( "go-up", QStyle::SP_ArrowUp ).pixmap( smallIconSize ) );