]> granicus.if.org Git - transmission/commitdiff
(trunk qt) sync the Qt client's statusbar with the GTK+ client's wrt #3344 and #2793
authorCharles Kerr <charles@transmissionbt.com>
Fri, 25 Jun 2010 21:04:33 +0000 (21:04 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Fri, 25 Jun 2010 21:04:33 +0000 (21:04 +0000)
qt/mainwin.cc
qt/mainwin.h

index 9347368f8645c85b7c95674364118aeb386c0a90..2427cad24548323024a4cf958271a6b434e54652 100644 (file)
@@ -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( ) );
 
index 85a83b5522f35309366c5dadf7f1fda96e7583c3..8e023cd38b26782b71d922525bcfde3106634dc0 100644 (file)
@@ -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;