From: Charles Kerr Date: Fri, 25 Jun 2010 21:04:33 +0000 (+0000) Subject: (trunk qt) sync the Qt client's statusbar with the GTK+ client's wrt #3344 and #2793 X-Git-Tag: 2.10~356 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4094dc254440a0840b8ce073b197b50aedbd496e;p=transmission (trunk qt) sync the Qt client's statusbar with the GTK+ client's wrt #3344 and #2793 --- diff --git a/qt/mainwin.cc b/qt/mainwin.cc index 9347368f8..2427cad24 100644 --- a/qt/mainwin.cc +++ b/qt/mainwin.cc @@ -438,8 +438,8 @@ QWidget * TrMainWindow :: createStatusBar( ) { QMenu * m; - QLabel *l, *l2; - QWidget *w; + QLabel * l; + QWidget * w; QHBoxLayout * h; QPushButton * p; QActionGroup * a; @@ -500,27 +500,29 @@ TrMainWindow :: createStatusBar( ) l = myStatsLabel = new QLabel( this ); h->addWidget( l ); + h->addSpacing( HIG::PAD_BIG ); + w = new QWidget( this ); w->setMinimumSize( HIG::PAD_BIG, 1 ); w->setMaximumSize( HIG::PAD_BIG, 1 ); h->addWidget( w ); + l = myDownloadSpeedLabel = new QLabel( this ); + h->addWidget( l ); l = new QLabel( this ); l->setPixmap( getStockIcon( "go-down", QStyle::SP_ArrowDown ).pixmap( smallIconSize ) ); h->addWidget( l ); - l2 = myDownloadSpeedLabel = new QLabel( this ); - h->addWidget( l2 ); - myDownStatusWidgets << w << l << l2; + + h->addSpacing( HIG::PAD_BIG ); w = new QWidget( this ); w->setMinimumSize( HIG::PAD_BIG, 1 ); w->setMaximumSize( HIG::PAD_BIG, 1 ); h->addWidget( w ); + l = myUploadSpeedLabel = new QLabel; + h->addWidget( l ); l = new QLabel; l->setPixmap( getStockIcon( "go-up", QStyle::SP_ArrowUp ).pixmap( smallIconSize ) ); h->addWidget( l ); - l2 = myUploadSpeedLabel = new QLabel; - h->addWidget( l2 ); - myUpStatusWidgets << w << l << l2; return top; } @@ -733,8 +735,6 @@ TrMainWindow :: refreshStatusBar( ) const Speed down( myModel.getDownloadSpeed( ) ); myUploadSpeedLabel->setText( Utils :: speedToString( up ) ); myDownloadSpeedLabel->setText( Utils :: speedToString( down ) ); - foreach( QWidget * w, myUpStatusWidgets ) w->setVisible( !up.isZero( ) ); - foreach( QWidget * w, myDownStatusWidgets ) w->setVisible( !down.isZero( ) ); myNetworkLabel->setVisible( !mySession.isServer( ) ); diff --git a/qt/mainwin.h b/qt/mainwin.h index 85a83b552..8e023cd38 100644 --- a/qt/mainwin.h +++ b/qt/mainwin.h @@ -158,8 +158,6 @@ class TrMainWindow: public QMainWindow QMenu * createOptionsMenu( void ); QWidget * createStatusBar( void ); QWidget * myStatusBar; - QWidgetList myUpStatusWidgets; - QWidgetList myDownStatusWidgets; QPushButton * myAltSpeedButton; QPushButton * myOptionsButton; QLabel * myVisibleCountLabel;