[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[vidalia-svn] r1232: If we're only displaying the Send line on the bandwidth grap (trunk/src/gui/bwgraph)



Author: edmanm
Date: 2006-09-23 01:22:10 -0400 (Sat, 23 Sep 2006)
New Revision: 1232

Modified:
   trunk/src/gui/bwgraph/graphframe.cpp
Log:
If we're only displaying the Send line on the bandwidth graph, paint the Send
stats in the position that would've been taken by the Receive stats. Also add
a little vertical spacing on non-Mac, since the text rows look smushed together 
everywhere but on my Mac.


Modified: trunk/src/gui/bwgraph/graphframe.cpp
===================================================================
--- trunk/src/gui/bwgraph/graphframe.cpp	2006-09-23 04:30:16 UTC (rev 1231)
+++ trunk/src/gui/bwgraph/graphframe.cpp	2006-09-23 05:22:10 UTC (rev 1232)
@@ -246,20 +246,28 @@
 void
 GraphFrame::paintTotals()
 {
-  int x = SCALE_WIDTH + FONT_SIZE;
-  
+  int x = SCALE_WIDTH + FONT_SIZE, y = 0;
+  int rowHeight = FONT_SIZE;
+
+#if !defined(Q_WS_MAC)
+  /* On Mac, we don't need vertical spacing between the text rows. */
+  rowHeight += 5;
+#endif
+
   /* If total received is selected */
   if (_showRecv) {
+    y = rowHeight;
     _painter->setPen(RECV_COLOR);
-    _painter->drawText(x, FONT_SIZE,
+    _painter->drawText(x, y,
         tr("Recv: ") + totalToStr(_totalRecv) + 
         " ("+tr("%1 KB/s").arg(_recvData->first(), 0, 'f', 2)+")");
   }
 
   /* If total sent is selected */
   if (_showSend) {
+    y += rowHeight;
     _painter->setPen(SEND_COLOR);
-    _painter->drawText(x, (2*FONT_SIZE),
+    _painter->drawText(x, y,
         tr("Sent: ") + totalToStr(_totalSend) +
         " ("+tr("%1 KB/s").arg(_sendData->first(), 0, 'f', 2)+")");
   }